.NET: Update HostedAgents samples to Azure.AI.AgentServer.AgentFramework 1.0.0-beta.9 and MEAI 10.3.0#4477
Open
.NET: Update HostedAgents samples to Azure.AI.AgentServer.AgentFramework 1.0.0-beta.9 and MEAI 10.3.0#4477
Conversation
…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
- 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>
…ve from AgentFramework) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
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.AgentFrameworkto1.0.0-beta.9across all HostedAgents samples, and update select samples toMicrosoft.Extensions.AI.OpenAI10.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. |
dotnet/samples/05-end-to-end/HostedAgents/AgentWithLocalTools/Program.cs
Outdated
Show resolved
Hide resolved
dotnet/samples/05-end-to-end/HostedAgents/AgentWithTextSearchRag/Program.cs
Show resolved
Hide resolved
dotnet/samples/05-end-to-end/HostedAgents/AgentWithTools/Program.cs
Outdated
Show resolved
Hide resolved
…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>
SergeyMenshykh
approved these changes
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" /> |
Member
There was a problem hiding this comment.
Should not it be 2.8.0-beta.1?
westey-m
reviewed
Mar 5, 2026
Comment on lines
+30
to
+31
| .AsIChatClient() | ||
| .AsAIAgent(new ChatClientAgentOptions |
Contributor
There was a problem hiding this comment.
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 |
westey-m
approved these changes
Mar 5, 2026
…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>
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
Align all HostedAgents samples to
Azure.AI.AgentServer.AgentFramework1.0.0-beta.9 andMicrosoft.Extensions.AI.OpenAI10.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:Microsoft.Extensions.AI.OpenAI→ 10.3.0 in 3 samples that were on older previews:The remaining 3 samples (AgentWithTools, AgentWithHostedMCP, AgentWithLocalTools) were already on MEAI 10.3.0.
Contribution Checklist
💡 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.