Skip to content

.NET: Add foundry extension samples for dotnet#4359

Merged
rogerbarreto merged 23 commits into
microsoft:mainfrom
yaoleo34:leoyao-samples
Mar 5, 2026
Merged

.NET: Add foundry extension samples for dotnet#4359
rogerbarreto merged 23 commits into
microsoft:mainfrom
yaoleo34:leoyao-samples

Conversation

@yaoleo34

Copy link
Copy Markdown
Contributor

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):

  • New multi-agent workflow implementation:
    Introduces a new sample in foundry_multiagent that creates and orchestrates two agents (Writer and Reviewer) using the AgentServer SDK

Single-Agent Sample (foundry_single_agent):

  • Seattle Hotel Agent implementation:
    Adds a new sample agent that provides hotel recommendations in Seattle, including a tool function for simulated hotel availability.

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.

Copilot AI review requested due to automatic review settings February 27, 2026 19:53
@markwallace-microsoft markwallace-microsoft added documentation Usage: [Issues, PRs], Target: documentation in the code base and learn docs python Usage: [Issues, PRs], Target: Python .NET Usage: [Issues, PRs], Target: .Net labels Feb 27, 2026
@github-actions github-actions Bot changed the title Add foundry extension samples for python and dotnet Python: Add foundry extension samples for python and dotnet Feb 27, 2026
@github-actions github-actions Bot changed the title Python: Add foundry extension samples for python and dotnet .NET: Add foundry extension samples for python and dotnet Feb 27, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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) and foundry_multiagent (writer/reviewer workflow), with Dockerfiles + Foundry agent.yaml manifests.
  • 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

Comment thread python/samples/05-end-to-end/hosted_agents/foundry_multiagent/main.py Outdated
Comment thread dotnet/samples/05-end-to-end/HostedAgents/foundry_single_agent/agent.yaml Outdated
rogerbarreto and others added 5 commits February 27, 2026 20:06
- 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>
Comment thread python/samples/05-end-to-end/hosted_agents/foundry_single_agent/README.md Outdated
Comment thread python/samples/05-end-to-end/hosted_agents/foundry_multiagent/README.md Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Usage: [Issues, PRs], Target: documentation in the code base and learn docs .NET Usage: [Issues, PRs], Target: .Net python Usage: [Issues, PRs], Target: Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants