.NET: Add File Search Sample for Foundry Agents.#3990
Open
rogerbarreto wants to merge 5 commits intomicrosoft:mainfrom
Open
.NET: Add File Search Sample for Foundry Agents.#3990rogerbarreto wants to merge 5 commits intomicrosoft:mainfrom
rogerbarreto wants to merge 5 commits intomicrosoft:mainfrom
Conversation
…nto feature/3674-file-search
- Add FoundryAgents_Step18_FileSearch to agent-framework-dotnet.slnx - Add FileSearch entry to FoundryAgents samples table in README.md - Fix README inaccuracy: sample creates one agent, not two Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Refactor agent creation into switchable local functions - Use DefaultAzureCredential with WARNING comment (matching other samples) - Update README to reference DefaultAzureCredential Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new .NET “File search” getting-started sample under Foundry Agents, documenting and wiring it into the sample index/solution so developers can see how to use vector stores + file search tools with the Agent Framework and the native SDK.
Changes:
- Adds
FoundryAgents_Step18_FileSearchsample project (code + README) demonstrating file upload, vector store creation, and file-search-enabled agent execution. - Updates the Foundry Agents samples README to include the new sample link.
- Adds the new sample project to the
dotnet/agent-framework-dotnet.slnxsolution.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| dotnet/samples/GettingStarted/FoundryAgents/README.md | Adds the new “File search” sample to the samples table. |
| dotnet/samples/GettingStarted/FoundryAgents/FoundryAgents_Step18_FileSearch/README.md | Documents prerequisites, environment variables, and expected behavior for the new sample. |
| dotnet/samples/GettingStarted/FoundryAgents/FoundryAgents_Step18_FileSearch/Program.cs | Implements the end-to-end file upload → vector store → agent run → citation display → cleanup flow. |
| dotnet/samples/GettingStarted/FoundryAgents/FoundryAgents_Step18_FileSearch/FoundryAgents_Step18_FileSearch.csproj | Introduces the new sample project and references required packages/projects. |
| dotnet/agent-framework-dotnet.slnx | Adds the new sample project to the solution. |
dotnet/samples/GettingStarted/FoundryAgents/FoundryAgents_Step18_FileSearch/Program.cs
Outdated
Show resolved
Hide resolved
dotnet/samples/GettingStarted/FoundryAgents/FoundryAgents_Step18_FileSearch/Program.cs
Show resolved
Hide resolved
Use Path.Combine + Path.GetRandomFileName instead of Path.GetTempFileName to avoid leaving an orphaned temp file on disk. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
SergeyMenshykh
approved these changes
Feb 18, 2026
westey-m
reviewed
Feb 18, 2026
| |[Code interpreter](./FoundryAgents_Step14_CodeInterpreter/)|This sample demonstrates how to use the code interpreter tool with a Foundry agent| | ||
| |[Computer use](./FoundryAgents_Step15_ComputerUse/)|This sample demonstrates how to use computer use capabilities with a Foundry agent| | ||
| |[File search](./FoundryAgents_Step18_FileSearch/)|This sample demonstrates how to use the file search tool with a Foundry agent| | ||
| |[Local MCP](./FoundryAgents_Step27_LocalMCP/)|This sample demonstrates how to use a local MCP client with a Foundry agent| |
Contributor
There was a problem hiding this comment.
Not related to this PR, so feel free to ignore or include in a follow up PR, but it doesn't look like step27 is in the solution.
westey-m
approved these changes
Feb 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation and Context
Adds a new FoundryAgents_Step18_FileSearch sample demonstrating how to use the File Search tool with AI Agents.
Description
HostedFileSearchTool(MEAI + AgentFramework abstraction)ResponseTool.CreateFileSearchTool(Native SDK)Changes
FoundryAgents_Step18_FileSearchwithProgram.csandREADME.mdagent-framework-dotnet.slnxREADME.md