Skip to content

.NET: Add foundry extension samples for python and dotnet#4359

Open
yaoleo34 wants to merge 21 commits intomicrosoft:mainfrom
yaoleo34:leoyao-samples
Open

.NET: Add foundry extension samples for python and dotnet#4359
yaoleo34 wants to merge 21 commits intomicrosoft:mainfrom
yaoleo34:leoyao-samples

Conversation

@yaoleo34
Copy link

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 Improvements or additions to documentation python .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
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 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

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>
@rogerbarreto rogerbarreto added this pull request to the merge queue Mar 3, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 3, 2026
@rogerbarreto
Copy link
Member

Unrelated Integration Tests failing

cc: @TaoChenOSU

Failed Microsoft.Agents.AI.Workflows.UnitTests.ObservabilityTests.CreatesWorkflowEndToEndActivities_WithCorrectName_DefaultAsync [1 s]
  Error Message:
   Expected capturedActivities to contain 9 item(s) because Exactly 9 activities should be created., but found 10: System.Diagnostics.Activity
    {

…aultAsync

Tracked in microsoft#4398

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Member

@eavanvalkenburg eavanvalkenburg left a comment

Choose a reason for hiding this comment

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

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 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>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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 python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants