Skip to content

.NET: Update HostedAgents samples to Azure.AI.AgentServer.AgentFramework 1.0.0-beta.9 and MEAI 10.3.0#4477

Open
Copilot wants to merge 10 commits intomainfrom
copilot/update-sample-references-to-1-0-0-beta-9
Open

.NET: Update HostedAgents samples to Azure.AI.AgentServer.AgentFramework 1.0.0-beta.9 and MEAI 10.3.0#4477
Copilot wants to merge 10 commits intomainfrom
copilot/update-sample-references-to-1-0-0-beta-9

Conversation

Copy link
Contributor

Copilot AI commented Mar 4, 2026

Motivation and Context

Align all HostedAgents samples to Azure.AI.AgentServer.AgentFramework 1.0.0-beta.9 and Microsoft.Extensions.AI.OpenAI 10.3.0. Several samples were pinned to older beta versions (beta.5, beta.6, beta.8) and preview MEAI builds.

Description

Azure.AI.AgentServer.AgentFramework → 1.0.0-beta.9 across all 6 samples:

  • AgentWithTools, AgentWithLocalTools, AgentThreadAndHITL (from beta.8)
  • AgentWithHostedMCP (from beta.6)
  • AgentWithTextSearchRag, AgentsInWorkflows (from beta.5)

Microsoft.Extensions.AI.OpenAI → 10.3.0 in 3 samples that were on older previews:

  • AgentThreadAndHITL (from 10.1.1-preview.1.25612.2)
  • AgentWithTextSearchRag (from 10.1.1-preview.1.25612.2)
  • AgentsInWorkflows (from 10.1.0-preview.1.25608.1)

The remaining 3 samples (AgentWithTools, AgentWithHostedMCP, AgentWithLocalTools) were already on MEAI 10.3.0.

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.

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…0.0-beta.9 and MEAI 10.3.0

Co-authored-by: rogerbarreto <19890735+rogerbarreto@users.noreply.github.com>
Copilot AI changed the title [WIP] Update sample references to Azure.AI.AgentServer.AgentFramework 1.0.0-beta.9 Update HostedAgents samples to Azure.AI.AgentServer.AgentFramework 1.0.0-beta.9 and MEAI 10.3.0 Mar 4, 2026
rogerbarreto and others added 2 commits March 4, 2026 20:55
- Rename CreateAIAgent -> AsAIAgent (AgentThreadAndHITL, AgentWithHostedMCP, AgentWithTextSearchRag)
- Rename AsAgent -> AsAIAgent (AgentsInWorkflows)
- Replace AIContextProviderFactory with AIContextProviders and simplified TextSearchProvider ctor (AgentWithTextSearchRag)
- Update Microsoft.Agents.AI.OpenAI to 1.0.0-rc2 (AgentThreadAndHITL, AgentWithTextSearchRag, AgentWithTools)
- Update Microsoft.Agents.AI.Workflows to 1.0.0-rc2 (AgentsInWorkflows)
- Add Microsoft.Agents.AI 1.0.0-rc2 reference (AgentWithHostedMCP)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ojects to slnx

- Use DefaultAzureCredential consistently across all samples
- Add AgentThreadAndHITL, AgentWithLocalTools, AgentWithTools to slnx
- Apply dotnet format

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions bot changed the title Update HostedAgents samples to Azure.AI.AgentServer.AgentFramework 1.0.0-beta.9 and MEAI 10.3.0 .NET: Update HostedAgents samples to Azure.AI.AgentServer.AgentFramework 1.0.0-beta.9 and MEAI 10.3.0 Mar 5, 2026
@rogerbarreto rogerbarreto marked this pull request as ready for review March 5, 2026 10:58
Copilot AI review requested due to automatic review settings March 5, 2026 10:58
…ve from AgentFramework)

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

Updates the .NET HostedAgents end-to-end samples to align with newer Azure AI AgentServer AgentFramework and Microsoft.Extensions.AI.OpenAI package versions, and adjusts sample code to match updated extension APIs.

Changes:

  • Bump Azure.AI.AgentServer.AgentFramework to 1.0.0-beta.9 across all HostedAgents samples, and update select samples to Microsoft.Extensions.AI.OpenAI 10.3.0.
  • Update sample code to use newer agent creation APIs (e.g., .AsAIAgent() and updated AI context provider configuration).
  • Add missing HostedAgents sample projects to dotnet/agent-framework-dotnet.slnx.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
dotnet/samples/05-end-to-end/HostedAgents/AgentsInWorkflows/Program.cs Updates workflow-to-agent conversion API usage (AsAIAgent) and removes DefaultAzureCredential warning comment.
dotnet/samples/05-end-to-end/HostedAgents/AgentsInWorkflows/AgentsInWorkflows.csproj Updates AgentFramework + Workflows + MEAI package versions.
dotnet/samples/05-end-to-end/HostedAgents/AgentWithTools/Program.cs Switches auth credential to DefaultAzureCredential.
dotnet/samples/05-end-to-end/HostedAgents/AgentWithTools/AgentWithTools.csproj Updates AgentFramework + Microsoft.Agents.AI.OpenAI package versions.
dotnet/samples/05-end-to-end/HostedAgents/AgentWithTextSearchRag/Program.cs Updates agent creation API and moves to AIContextProviders configuration.
dotnet/samples/05-end-to-end/HostedAgents/AgentWithTextSearchRag/AgentWithTextSearchRag.csproj Updates AgentFramework + Microsoft.Agents.AI.OpenAI + MEAI package versions.
dotnet/samples/05-end-to-end/HostedAgents/AgentWithLocalTools/Program.cs Switches auth credential to DefaultAzureCredential.
dotnet/samples/05-end-to-end/HostedAgents/AgentWithLocalTools/AgentWithLocalTools.csproj Updates AgentFramework package version.
dotnet/samples/05-end-to-end/HostedAgents/AgentWithHostedMCP/Program.cs Updates agent creation API to AsAIAgent and removes DefaultAzureCredential warning comment.
dotnet/samples/05-end-to-end/HostedAgents/AgentWithHostedMCP/AgentWithHostedMCP.csproj Updates AgentFramework version and adds Microsoft.Agents.AI dependency.
dotnet/samples/05-end-to-end/HostedAgents/AgentThreadAndHITL/Program.cs Switches auth credential and updates agent creation API to AsAIAgent.
dotnet/samples/05-end-to-end/HostedAgents/AgentThreadAndHITL/AgentThreadAndHITL.csproj Updates AgentFramework + Microsoft.Agents.AI.OpenAI + MEAI package versions.
dotnet/agent-framework-dotnet.slnx Adds HostedAgents sample projects to the solution.

…gents samples

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace AzureCliCredential references with DefaultAzureCredential in all
HostedAgents README files to match the actual sample code.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@markwallace-microsoft markwallace-microsoft added the documentation Improvements or additions to documentation label Mar 5, 2026
<ItemGroup>
<PackageReference Include="Azure.AI.AgentServer.AgentFramework" Version="1.0.0-beta.5" />
<PackageReference Include="Azure.AI.AgentServer.AgentFramework" Version="1.0.0-beta.9" />
<PackageReference Include="Azure.AI.OpenAI" Version="2.7.0-beta.2" />
Copy link
Member

Choose a reason for hiding this comment

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

Should not it be 2.8.0-beta.1?

Comment on lines +30 to +31
.AsIChatClient()
.AsAIAgent(new ChatClientAgentOptions
Copy link
Contributor

Choose a reason for hiding this comment

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

We have the AsAIAgent extension on the OpenAI ChatClient as well. Do we need the AsIChatClient call here?

Suggested change
.AsIChatClient()
.AsAIAgent(new ChatClientAgentOptions
.AsAIAgent(new ChatClientAgentOptions

rogerbarreto and others added 2 commits March 5, 2026 12:37
…I and remove AsIChatClient()

Swap package references from Microsoft.Extensions.AI.OpenAI to
Microsoft.Agents.AI.OpenAI across all 6 HostedAgents samples. This enables
using the AsAIAgent() extension directly on ChatClient/ResponsesClient
(from OpenAI.Chat/OpenAI.Responses namespaces), removing the intermediate
AsIChatClient() call in 3 samples where it was unnecessary.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… samples

Replace var with explicit types for clarity in all 6 samples. Replace
new ChatClientAgent() constructor calls with chatClient.AsAIAgent()
extension method in AgentWithLocalTools and AgentsInWorkflows.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants