- Web Search uses Grounding with Bing Search and Grounding with Bing Custom Search, which are First Party Consumption Services governed by these Grounding with Bing terms of use and the Microsoft Privacy Statement.
- The Microsoft Data Protection Addendum doesn’t apply to data sent to Grounding with Bing Search and Grounding with Bing Custom Search. When you use Grounding with Bing Search and Grounding with Bing Custom Search, data transfers occur outside compliance and geographic boundaries.
- Use of Grounding with Bing Search and Grounding with Bing Custom Search incurs costs. See pricing for details.
- See the management section for information about how Azure admins can manage access to use of web search.
Prerequisites
- A basic or standard agent environment
- The latest SDK package. The .NET SDK is currently in preview. See the quickstart for details.
- Foundry User role on the Foundry project to create and run agents.
The Foundry RBAC roles were recently renamed. Foundry User, Foundry Owner, Foundry Account Owner, and Foundry Project Manager were previously named Azure AI User, Azure AI Owner, Azure AI Account Owner, and Azure AI Project Manager. You might still see the previous names in some places while the rename rolls out. The role IDs and core permissions are unchanged by the rename.
- Foundry Project Manager role on the Foundry project if you create the remote-tool project connection for domain-restricted search.
- Azure credentials configured for authentication (such as
DefaultAzureCredential). - Your Foundry project endpoint URL and a model deployment name.
Choose a web grounding scenario
Add web search directly to an agent
Start with the Prompt Agents tab. It addsWebSearchTool directly to a server-side agent and doesn’t require a toolbox or a separate Bing project connection. This path provides the shortest route to a grounded response with citations.
The Hosted Agents tab uses WebSearchToolboxTool to add web search to a toolbox, then connects to the toolbox MCP endpoint. Keep the direct-agent and toolbox tool types separate because they apply to different API surfaces.
For information on optimizing tool usage, see best practices.
Configure the web search tool
You can configure web search behavior when you create your agent.Web search response format over MCP
When Web Search returns results over MCP, the response is a
resource content item containing the synthesized answer with inline Markdown source links. URL citations are in content[].resource._meta.annotations[]. For example:Optional parameters for general web search
user_location: Helps web search return results relevant to a user’s geography. Use an approximate location when you want results localized to a country/region/city.search_context_size: Controls how much context window space to use for the search. Supported values arelow,medium, andhigh. The default ismedium.
Security and privacy considerations
- Treat web search results as untrusted input. Validate and sanitize data before you use it in downstream systems.
- Avoid sending secrets or sensitive personal data in prompts that might be forwarded to external services.
- Review the terms, privacy, and data boundary notes in the preview section of this article before enabling web search in production.
Known limitations
For information about web search behavior and limitations in the Responses API, see Web search with the Responses API.Troubleshooting
Administrator control for the web search tool
You can enable or disable the web search tool in Foundry Agent Service at the subscription level by using Azure CLI. This setting applies to all accounts within the specified subscription.Prerequisites
Before running the following commands, make sure that you:- Have Azure CLI installed.
- Are signed in to Azure by using
az login. - Activate Contributor at subscription scope just in time through Microsoft Entra PIM. Subscription scope is required because this setting applies to all Foundry resources in the subscription. Deactivate the role after changing the setting. Day-to-day agent developers and runtime users don’t need this role.