Skip to content

.NET: Add Foundry Agents Tool Sample - Web Search#4040

Merged
rogerbarreto merged 7 commits intomicrosoft:mainfrom
rogerbarreto:feature/3674-web-search
Feb 23, 2026
Merged

.NET: Add Foundry Agents Tool Sample - Web Search#4040
rogerbarreto merged 7 commits intomicrosoft:mainfrom
rogerbarreto:feature/3674-web-search

Conversation

@rogerbarreto
Copy link
Member

Motivation and Context

Adds a new FoundryAgents_Step25_WebSearch sample demonstrating how to use the Responses API built-in web search tool with AI Agents.

Description

  • Create agents with web search capabilities using two approaches:
    • Option 1: HostedWebSearchTool (MEAI + AgentFramework abstraction)
    • Option 2: ResponseTool.CreateWebSearchTool() (Native SDK / Responses API)
  • Extract text responses and URL citations from agent responses
  • Manage agent lifecycle (create and cleanup)

Note: The web search tool uses the built-in Responses API web search capability. No Bing Grounding connection is required.

Changes

  • New sample: FoundryAgents_Step25_WebSearch with Program.cs and README.md

Contribution Checklist

  • The code builds clean without any errors or warnings
  • The PR follows the Contribution Guidelines
  • All unit tests pass, and I have added new tests where possible
  • Is this a breaking change? If yes, add "[BREAKING]" prefix to the title of the PR.

rogerbarreto and others added 2 commits February 5, 2026 14:31
Remove incorrect Bing Grounding connection ID requirement from the
WebSearch sample. The web search tool uses the OpenAI Responses API
built-in capability and does not need a connection ID.

- Remove AZURE_FOUNDRY_BING_CONNECTION_ID env var requirement
- Use HostedWebSearchTool() without connectionId properties
- Refactor creation options into local functions (MEAI + NativeSDK)
- Switch from AzureCliCredential to DefaultAzureCredential
- Update README to reflect correct prerequisites

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings February 18, 2026 17:28
@rogerbarreto rogerbarreto added documentation Improvements or additions to documentation .NET labels Feb 18, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new .NET GettingStarted FoundryAgents_Step25_WebSearch sample demonstrating how to enable the Responses API built-in web search tool on Foundry Agents, run a query, and extract text + URL citation annotations.

Changes:

  • New console sample project (net10.0) that creates a Foundry agent with web search tooling (MEAI hosted tool, with a native SDK option shown).
  • Adds output processing to print text responses and URL citation annotations.
  • Adds a README with prerequisites and run instructions for the new step.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
dotnet/samples/GettingStarted/FoundryAgents/FoundryAgents_Step25_WebSearch/README.md Documents purpose, prerequisites, env vars, and execution steps for the web search sample.
dotnet/samples/GettingStarted/FoundryAgents/FoundryAgents_Step25_WebSearch/Program.cs Implements agent creation (web search enabled), execution, citation extraction, and cleanup.
dotnet/samples/GettingStarted/FoundryAgents/FoundryAgents_Step25_WebSearch/FoundryAgents_Step25_WebSearch.csproj New sample project definition and dependencies.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
rogerbarreto and others added 2 commits February 23, 2026 15:52
- Add FoundryAgents_Step25_WebSearch to agent-framework-dotnet.slnx
- Add web search sample entry to parent FoundryAgents README.md
- Simplify text response extraction to use response.Text directly

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@rogerbarreto rogerbarreto added this pull request to the merge queue Feb 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation .NET

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants