Grounding with Bing Search is NOT programmatically callable via azure-ai-agents today
This is not documented clearly, but it is now confirmed by:
SDK behaviour
Error type
Azure support responses
exact symptoms
The SDK cannot see or bind the grounding connection you created in the portal.
Details:
Objective
data-enrichment for company names using Azure AI Foundry Agents with Grounding with Bing Search, triggered programmatically from Python.
The goal is to:
Query Bing Search via Foundry Agents
Retrieve authoritative public web data (company websites, social profiles, phone/email, addresses)
Populate structured enrichment fields in Excel/CSV outputs
Enforce strict “no hallucination” / “not found if uncertain” behaviour
Environment
Azure AI Foundry
Grounding with Bing Search (configured via Azure Portal → Connected resources)
azure-ai-projects SDK v1.0.0
azure-ai-agents SDK v1.1.0
Python 3.13 (Windows)
Agent creation and execution via AIProjectClient
Expected Behaviour
Python script should be able to:
Create or reuse an agent
Bind the “Grounding with Bing Search” connection
Execute grounded Bing queries
Receive grounded results (with citations)
Populate enrichment fields programmatically
This behaviour works in the Foundry Playground UI, so the assumption is that the SDK should support the same capability.
Actual Behaviour / Symptoms
Agent creation via SDK succeeds, but every Bing-grounded run fails with:
tool_user_error
invalid_tool_input
The specified connection ID '<connection>' was not found in the project or account connections
This occurs regardless of:
Using the full ARM connection ID
Using the short connection name
Logging confirms the correct value is read from environment variables
2. SDK silently ignores the provided Bing connection
Even when the script logs:
BING_CONNECTION_ID = [instance name] Using connection name as provided: [instance name]
The runtime error shows the SDK attempting to resolve the project root instead:
.../accounts/<resource>/projects/<project>
This proves the connection parameter is not actually bound at runtime.
3. Attempting to bind connections explicitly is unsupported
Passing:
connections={ "bing_search": bing_conn }
into create_agent() causes:
TypeError: Session.request() got an unexpected keyword argument 'connections'
This confirms:
The installed SDK does not support connection binding
The HTTP client rejects the argument
The SDK documentation and examples are inconsistent with the released package
4. Behaviour differs from Playground
Playground: Bing grounding works
SDK: Bing grounding fails consistently
This indicates:
Playground injects connections internally
SDK cannot see or bind the same connection
Verified connection exists in Azure Portal → Connected resources
Tested both:
Full ARM connection ID
Short connection name
Confirmed environment variables are read correctly
Confirmed agent reuse vs forced recreation
Tried multiple agent names / versions
Removed all client-side validation checks
Validated no Python scoping or indentation errors
Confirmed authentication via Entra ID (device login)
Confirmed SDK versions and compatibility
Confirmed errors originate from tool execution phase, not agent creation
Azure support response confirms:
Foundry Agents do not expose configuration switches (citations, strict grounding, etc.)
Bing grounding is implicitly invoked
There is no UI or SDK control to force strict grounding
SDK tooling is limited and behaviour differs from Playground
Recommendation was to use:
Prompt instructions as a workaround
Bing Custom Search for programmatic use
This aligns with observed behaviour.
Root Cause (Conclusion)
The Azure AI Foundry SDK cannot see or bind the “Grounding with Bing Search” connection created in the Azure Portal.
Specifically:
Grounding with Bing Search appears to be UI-only
The SDK does not expose a supported mechanism to attach or reference the connection at runtime
The agent falls back to the project root instead of a valid Bing connection
This results in consistent invalid_tool_input errors
This is a platform limitation, not a client-side bug.
Why This Cannot Be Fixed Client-Side
No supported SDK parameter exists to bind Bing grounding
connections= is rejected at the transport layer
Tool configuration is opaque and undocumented
Playground behaviour cannot be replicated programmatically
Error occurs after successful authentication and agent creation
All reasonable configuration permutations have been tested
Impact
Grounding with Bing Search cannot be used programmatically
Automation pipelines cannot rely on Foundry Agents for enrichment
Only manual Playground usage is currently viable
Forces abandonment of Foundry for deterministic enrichment workflows
Request to Azure
Clarification is requested on:
Whether Grounding with Bing Search is intended to be SDK-usable
If so, how connections are meant to be bound programmatically
If not, confirmation that it is Playground-only
Whether SDK support is planned or deprecated