.NET: Bump Azure.AI.Projects to 2.0.0 GA#5060
Merged
rogerbarreto merged 2 commits intomicrosoft:mainfrom Apr 2, 2026
Merged
Conversation
- Update Azure.AI.Projects from 2.0.0-beta.2 to 2.0.0 in CPM - Update Azure.Identity from 1.19.0 to 1.20.0 (transitive dep) - Update System.ClientModel from 1.9.0 to 1.10.0 (transitive dep) - Rename types per Azure.AI.Projects.Agents 2.0.0 breaking changes: - AgentVersion -> ProjectsAgentVersion - AgentRecord -> ProjectsAgentRecord - AgentDefinition -> ProjectsAgentDefinition - AgentVersionCreationOptions -> ProjectsAgentVersionCreationOptions - PromptAgentDefinition -> DeclarativeAgentDefinition - AgentTool -> ProjectsAgentTool - AgentsClient -> AgentAdministrationClient - .Agents property -> .AgentAdministrationClient - Add using Azure.AI.Projects.Memory namespace (types moved) - Update AGENTS.md with BOM and output capture conventions
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the .NET Foundry/Agents integration to align with Azure.AI.Projects 2.0.0 GA (and related dependency bumps), including adapting to the SDK’s breaking renames for agent administration, agent/version types, and declarative definitions, plus namespace moves for Memory types.
Changes:
- Bump CPM package versions: Azure.AI.Projects → 2.0.0, Azure.Identity → 1.20.0, System.ClientModel → 1.10.0.
- Migrate agent administration usage from
AIProjectClient.AgentstoAIProjectClient.AgentAdministrationClientand update renamed agent types (ProjectsAgent*) across src/tests/samples. - Update Foundry memory usage to the new
Azure.AI.Projects.Memorynamespace.
Reviewed changes
Copilot reviewed 39 out of 39 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/VisionAgentProvider.cs | Update integration test agent creation to ProjectsAgentVersion + DeclarativeAgentDefinition. |
| dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/TestAgentProvider.cs | Update integration test agent creation to new agent/version + definition types. |
| dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/PoemAgentProvider.cs | Update agent creation to ProjectsAgentVersion and declarative definitions. |
| dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/MathChatAgentProvider.cs | Update agent creation + declarative agent definitions for student/teacher. |
| dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/MarketingAgentProvider.cs | Update definitions and tool factory type name to ProjectsAgentTool (commented). |
| dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/FunctionToolAgentProvider.cs | Update agent creation + declarative definition typing for function tool agent. |
| dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/AgentProvider.cs | Base provider now uses ProjectsAgentVersion enumeration. |
| dotnet/tests/Microsoft.Agents.AI.Foundry.UnitTests/TestDataUtil.cs | Test JSON helper updated to ProjectsAgentDefinition serialization. |
| dotnet/tests/Microsoft.Agents.AI.Foundry.UnitTests/AzureAIProjectChatClientExtensionsTests.cs | Unit tests updated for ProjectsAgent* and declarative definitions/tool factories. |
| dotnet/tests/Foundry.IntegrationTests/Memory/FoundryMemoryProviderTests.cs | Add Azure.AI.Projects.Memory using for moved memory types. |
| dotnet/tests/Foundry.IntegrationTests/FoundryVersionedAgentFixture.cs | Fixture updated to AgentAdministrationClient + ProjectsAgentVersionCreationOptions. |
| dotnet/tests/Foundry.IntegrationTests/FoundryVersionedAgentCreateTests.cs | Integration tests updated for AgentAdministrationClient, declarative definitions, tool factories. |
| dotnet/src/Shared/Foundry/Agents/AgentFactory.cs | Shared agent creation helper migrated to new agent admin client + types. |
| dotnet/src/Microsoft.Agents.AI.Workflows.Declarative.Foundry/AzureAgentProvider.cs | Workflow declarative provider updated to ProjectsAgentVersion and new agent admin client. |
| dotnet/src/Microsoft.Agents.AI.Foundry/Memory/MemoryStoreExtensions.cs | Update memory namespace imports (Azure.AI.Projects.Memory). |
| dotnet/src/Microsoft.Agents.AI.Foundry/Memory/FoundryMemoryProvider.cs | Update memory namespace imports (Azure.AI.Projects.Memory). |
| dotnet/src/Microsoft.Agents.AI.Foundry/FoundryAITool.cs | Switch wrapper to ProjectsAgentTool and adjust docs accordingly. |
| dotnet/src/Microsoft.Agents.AI.Foundry/AzureAIProjectChatClientExtensions.cs | Update AsAIAgent overloads and internal plumbing to ProjectsAgent* + declarative definitions. |
| dotnet/src/Microsoft.Agents.AI.Foundry/AzureAIProjectChatClient.cs | Update stored agent metadata/service retrieval to ProjectsAgentRecord/Version + declarative model extraction. |
| dotnet/samples/05-end-to-end/A2AClientServer/A2AServer/HostAgentFactory.cs | Sample now queries agent via AgentAdministrationClient. |
| dotnet/samples/03-workflows/Declarative/ToolApproval/Program.cs | Samples updated to DeclarativeAgentDefinition. |
| dotnet/samples/03-workflows/Declarative/StudentTeacher/Program.cs | Samples updated to DeclarativeAgentDefinition. |
| dotnet/samples/03-workflows/Declarative/Marketing/Program.cs | Samples updated to declarative defs + ProjectsAgentTool references (commented). |
| dotnet/samples/03-workflows/Declarative/InvokeMcpTool/Program.cs | Sample updated to declarative definitions. |
| dotnet/samples/03-workflows/Declarative/InvokeFunctionTool/Program.cs | Sample updated to declarative definitions and typing. |
| dotnet/samples/03-workflows/Declarative/InputArguments/Program.cs | Sample updated to declarative definitions. |
| dotnet/samples/03-workflows/Declarative/HostedWorkflow/Program.cs | Workflow sample updated to ProjectsAgentVersion + declarative definitions. |
| dotnet/samples/03-workflows/Declarative/FunctionTools/Program.cs | Sample updated to declarative definitions and typing. |
| dotnet/samples/03-workflows/Declarative/DeepResearch/Program.cs | Sample updated to declarative definitions + ProjectsAgentTool OpenAPI tool creation. |
| dotnet/samples/03-workflows/Declarative/CustomerSupport/Program.cs | Sample updated to declarative definitions. |
| dotnet/samples/03-workflows/Agents/FoundryAgent/Program.cs | Sample updated to AgentAdministrationClient + ProjectsAgentVersionCreationOptions. |
| dotnet/samples/02-agents/ModelContextProtocol/FoundryAgent_Hosted_MCP/Program.cs | Sample updated to AgentAdministrationClient + new creation options/types. |
| dotnet/samples/02-agents/AgentWithRAG/AgentWithRAG_Step04_FoundryServiceRAG/Program.cs | Sample updated to AgentAdministrationClient + new creation options/types. |
| dotnet/samples/02-agents/AgentsWithFoundry/Agent_Step22_MemorySearch/Program.cs | Add Azure.AI.Projects.Memory import for moved memory types. |
| dotnet/samples/02-agents/AgentsWithFoundry/Agent_Step00_FoundryAgentLifecycle/Program.cs | Sample updated to AgentAdministrationClient + new creation options/types. |
| dotnet/samples/02-agents/Agents/Agent_Step07_AsMcpTool/Program.cs | Sample updated to AgentAdministrationClient + new creation options/types. |
| dotnet/samples/02-agents/AgentProviders/Agent_With_AzureAIProject/Program.cs | Sample updated to new admin client + projects agent types. |
| dotnet/Directory.Packages.props | CPM version bumps for Azure.AI.Projects/Azure.Identity/System.ClientModel. |
| dotnet/AGENTS.md | Add conventions for capturing dotnet command output and preserving UTF-8 BOM. |
Comments suppressed due to low confidence (1)
dotnet/src/Microsoft.Agents.AI.Foundry/AzureAIProjectChatClientExtensions.cs:402
promptAgentDefinitionis typed asDeclarativeAgentDefinition, which is misleading and makes the surrounding code harder to follow. Rename the local to reflect the actual type (e.g.,declarativeAgentDefinition).
if (agentDefinition is DeclarativeAgentDefinition promptAgentDefinition)
{
agentOptions.ChatOptions ??= chatOptions?.Clone() ?? new();
agentOptions.ChatOptions.Instructions = promptAgentDefinition.Instructions;
agentOptions.ChatOptions.Temperature = promptAgentDefinition.Temperature;
dotnet/src/Microsoft.Agents.AI.Workflows.Declarative.Foundry/AzureAgentProvider.cs
Show resolved
Hide resolved
dotnet/src/Microsoft.Agents.AI.Workflows.Declarative.Foundry/AzureAgentProvider.cs
Show resolved
Hide resolved
dotnet/src/Microsoft.Agents.AI.Foundry/AzureAIProjectChatClientExtensions.cs
Show resolved
Hide resolved
dotnet/tests/Microsoft.Agents.AI.Foundry.UnitTests/AzureAIProjectChatClientExtensionsTests.cs
Outdated
Show resolved
Hide resolved
SergeyMenshykh
approved these changes
Apr 2, 2026
dotnet/src/Microsoft.Agents.AI.Foundry/AzureAIProjectChatClientExtensions.cs
Show resolved
Hide resolved
westey-m
approved these changes
Apr 2, 2026
- Rename AIProjectClient parameter to aiProjectClient in AsChatClientAgent overloads - Fix XML doc: ProjectsAgentTool namespace from Azure.AI.Projects.OpenAI to Azure.AI.Projects.Agents - Rename test method to reflect DeclarativeAgentDefinition terminology
westey-m
approved these changes
Apr 2, 2026
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.
Summary
Upgrades \Azure.AI.Projects\ from \2.0.0-beta.2\ to \2.0.0\ GA, along with transitive dependency bumps and all breaking change adaptations.
Package Version Changes (CPM)
Breaking Changes Addressed
Per Azure.AI.Projects.Agents 2.0.0 release notes:
Per Azure.AI.Projects 2.0.0 release notes:
Validation
Notes