.NET: Add foundry extension samples for python and dotnet#4359
Open
yaoleo34 wants to merge 20 commits intomicrosoft:mainfrom
Open
.NET: Add foundry extension samples for python and dotnet#4359yaoleo34 wants to merge 20 commits intomicrosoft:mainfrom
yaoleo34 wants to merge 20 commits intomicrosoft:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds new Azure AI Foundry “hosted agent” samples (Python + .NET) to support local development and Foundry deployment scenarios, including a single-agent hotel assistant and a multi-agent writer/reviewer workflow.
Changes:
- Introduces Python hosted-agent samples:
foundry_single_agent(Seattle hotel tool) andfoundry_multiagent(writer/reviewer workflow), with Dockerfiles + Foundryagent.yamlmanifests. - Introduces .NET hosted-agent samples: single-agent hotel assistant and multi-agent writer/reviewer workflow, with Dockerfiles +
agent.yaml+ request examples. - Adds end-to-end sample documentation for running locally and deploying via the Foundry VS Code extension.
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| python/samples/05-end-to-end/hosted_agents/foundry_single_agent/requirements.txt | Python dependencies for the Foundry single-agent sample |
| python/samples/05-end-to-end/hosted_agents/foundry_single_agent/main.py | Seattle hotel agent implementation + local tool |
| python/samples/05-end-to-end/hosted_agents/foundry_single_agent/agent.yaml | Foundry hosted-agent manifest for Python single-agent |
| python/samples/05-end-to-end/hosted_agents/foundry_single_agent/README.md | Run/deploy documentation for Python single-agent |
| python/samples/05-end-to-end/hosted_agents/foundry_single_agent/Dockerfile | Container build/run for Python single-agent |
| python/samples/05-end-to-end/hosted_agents/foundry_multiagent/requirements.txt | Python dependencies for the multi-agent workflow sample |
| python/samples/05-end-to-end/hosted_agents/foundry_multiagent/main.py | Writer/Reviewer workflow + hosted server/CLI mode |
| python/samples/05-end-to-end/hosted_agents/foundry_multiagent/agent.yaml | Foundry hosted-agent manifest for Python multi-agent |
| python/samples/05-end-to-end/hosted_agents/foundry_multiagent/README.md | Run/deploy documentation for Python multi-agent |
| python/samples/05-end-to-end/hosted_agents/foundry_multiagent/Dockerfile | Container build/run for Python multi-agent |
| dotnet/samples/05-end-to-end/HostedAgents/foundry_single_agent/run-requests.http | Sample HTTP requests for local testing |
| dotnet/samples/05-end-to-end/HostedAgents/foundry_single_agent/dotnetsingle.csproj | .NET project definition and package references |
| dotnet/samples/05-end-to-end/HostedAgents/foundry_single_agent/agent.yaml | Foundry hosted-agent manifest for .NET single-agent |
| dotnet/samples/05-end-to-end/HostedAgents/foundry_single_agent/README.md | Run/deploy documentation for .NET single-agent |
| dotnet/samples/05-end-to-end/HostedAgents/foundry_single_agent/Program.cs | Seattle hotel agent implementation + local tool |
| dotnet/samples/05-end-to-end/HostedAgents/foundry_single_agent/Dockerfile | Container build/run for .NET single-agent |
| dotnet/samples/05-end-to-end/HostedAgents/foundry_multiagent/dotnetmultiagent.csproj | .NET multi-agent project definition and package references |
| dotnet/samples/05-end-to-end/HostedAgents/foundry_multiagent/appsettings.Development.json | Local dev config file for the multi-agent sample |
| dotnet/samples/05-end-to-end/HostedAgents/foundry_multiagent/agent.yaml | Foundry hosted-agent manifest for .NET multi-agent |
| dotnet/samples/05-end-to-end/HostedAgents/foundry_multiagent/README.md | Run/deploy documentation for .NET multi-agent |
| dotnet/samples/05-end-to-end/HostedAgents/foundry_multiagent/Program.cs | Writer/Reviewer workflow implementation + hosting |
| dotnet/samples/05-end-to-end/HostedAgents/foundry_multiagent/Dockerfile | Container build/run for .NET multi-agent |
python/samples/05-end-to-end/hosted_agents/foundry_multiagent/main.py
Outdated
Show resolved
Hide resolved
dotnet/samples/05-end-to-end/HostedAgents/foundry_single_agent/agent.yaml
Outdated
Show resolved
Hide resolved
dotnet/samples/05-end-to-end/HostedAgents/foundry_single_agent/dotnetsingle.csproj
Outdated
Show resolved
Hide resolved
dotnet/samples/05-end-to-end/HostedAgents/foundry_multiagent/dotnetmultiagent.csproj
Outdated
Show resolved
Hide resolved
dotnet/samples/05-end-to-end/HostedAgents/foundry_multiagent/appsettings.Development.json
Outdated
Show resolved
Hide resolved
- Fix Python multiagent indentation bug (from_agent_framework ran in both modes) - Remove hardcoded personal endpoint from appsettings.Development.json - Rename .NET folders/projects to PascalCase (FoundryMultiAgent, FoundrySingleAgent) - Upgrade .NET multiagent from net9.0 to net10.0 - Add ManagePackageVersionsCentrally=false and analyzer blocks to .csproj files - Replace wildcard package versions with fixed versions - Use alpine Docker images and standard build pattern - Align agent.yaml structure (template nesting, displayName, resources, authors) - Convert .NET multiagent from namespace/class to top-level statements - Add run-requests.http for multiagent sample - Fix Python requirements.txt (remove dev deps, add agent-framework) - Add proper copyright headers Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Fix TargetFrameworks (plural) to override inherited net472 from Directory.Build.props - Upgrade Azure.AI.AgentServer.AgentFramework to 1.0.0-beta.8 (latest) - Bump OpenTelemetry packages to 1.12.0 (required by beta.8) - Fix Roslynator/format errors (imports ordering, BOM, sealed record, target-typed new) - Verified with docker dotnet format (matching CI pipeline) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace PersistentAgentsClient and manual AzureOpenAIClient setup with AIProjectClient.CreateAIAgentAsync() from Microsoft.Agents.AI.AzureAI. - FoundryMultiAgent: Remove Azure.AI.Agents.Persistent, use CreateAIAgentAsync for Writer and Reviewer agents with cleanup in finally block - FoundrySingleAgent: Remove manual GetConnection/AzureOpenAIClient chain, use CreateAIAgentAsync with hotel search tool - Update csproj: add Microsoft.Agents.AI.AzureAI, remove unused packages Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Reference Microsoft.Agents.AI.AzureAI and Microsoft.Agents.AI.Workflows packages - Add Azure AI Developer role requirement for agents/write data action - Replace PersistentAgentsClient references Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Create dotnet/samples/05-end-to-end/HostedAgents/README.md with sample index - Create python/samples/05-end-to-end/hosted_agents/README.md with sample index - Add FoundryMultiAgent and FoundrySingleAgent to agent-framework-dotnet.slnx Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ng whitespace Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
huimiu
reviewed
Mar 2, 2026
python/samples/05-end-to-end/hosted_agents/foundry_single_agent/README.md
Outdated
Show resolved
Hide resolved
huimiu
reviewed
Mar 2, 2026
python/samples/05-end-to-end/hosted_agents/foundry_multiagent/README.md
Outdated
Show resolved
Hide resolved
Member
|
Unrelated Integration Tests failing cc: @TaoChenOSU |
…aultAsync Tracked in microsoft#4398 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
eavanvalkenburg
requested changes
Mar 4, 2026
Member
eavanvalkenburg
left a comment
There was a problem hiding this comment.
The python samples are not good, I would advice removing them from this PR and then once the agentserver package has been updated to work with rc2 resubmit them
python/samples/05-end-to-end/hosted_agents/foundry_multiagent/main.py
Outdated
Show resolved
Hide resolved
python/samples/05-end-to-end/hosted_agents/foundry_multiagent/main.py
Outdated
Show resolved
Hide resolved
python/samples/05-end-to-end/hosted_agents/foundry_multiagent/main.py
Outdated
Show resolved
Hide resolved
python/samples/05-end-to-end/hosted_agents/foundry_multiagent/main.py
Outdated
Show resolved
Hide resolved
python/samples/05-end-to-end/hosted_agents/foundry_multiagent/agent.yaml
Outdated
Show resolved
Hide resolved
python/samples/05-end-to-end/hosted_agents/foundry_single_agent/main.py
Outdated
Show resolved
Hide resolved
python/samples/05-end-to-end/hosted_agents/foundry_single_agent/main.py
Outdated
Show resolved
Hide resolved
python/samples/05-end-to-end/hosted_agents/foundry_single_agent/agent.yaml
Outdated
Show resolved
Hide resolved
Python hosted agent samples need further alignment with the azure-ai package conventions. Removing from this PR to ship .NET samples first. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
eavanvalkenburg
approved these changes
Mar 4, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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
Description
This pull request introduces a new multi-agent workflow sample (
foundry_multiagent) for Azure AI Foundry using the Microsoft Agent Framework. Both samples are designed for local development and deployment to Microsoft Foundry.Multi-Agent Workflow Sample (
foundry_multiagent):Introduces a new sample in
foundry_multiagentthat creates and orchestrates two agents (Writer and Reviewer) using the AgentServer SDKSingle-Agent Sample (
foundry_single_agent):Adds a new sample agent that provides hotel recommendations in Seattle, including a tool function for simulated hotel availability.
Contribution Checklist