From b979f6ad0c1e8873b55d18910c9a54bec1d45951 Mon Sep 17 00:00:00 2001 From: Roger Barreto <19890735+RogerBarreto@users.noreply.github.com> Date: Mon, 29 Jun 2026 10:41:55 +0100 Subject: [PATCH 1/4] .NET: Bump Azure.AI.Projects to 2.1.0-alpha.20260629.1 Bumps Azure.AI.Projects beta.3 to alpha.20260629.1 and aligns transitive deps (System.ClientModel 1.14.0, Azure.Core 1.59.0, Msal 4.84.2). Adapts to renamed AgentSessionFiles APIs (Upload/GetAll/Delete, scoped GetAgentSessionFiles, SizeInBytes), AgentToolboxes (CreateVersion/Delete), and strongly typed toolbox tools (WebSearchToolboxTool, MCPToolboxTool). Adds azure-sdk public dev feed for prerelease restore. --- dotnet/Directory.Packages.props | 8 ++++---- dotnet/nuget.config | 6 ++++++ .../Agent_Step25_FoundryToolboxMcp/Program.cs | 13 ++++++------ .../InvokeFoundryToolboxMcp/Program.cs | 15 +++++++------- .../SessionFilesHostedAgentTests.cs | 20 ++++++++----------- 5 files changed, 33 insertions(+), 29 deletions(-) diff --git a/dotnet/Directory.Packages.props b/dotnet/Directory.Packages.props index 3d30f24e6ee..d107e1b7c0a 100644 --- a/dotnet/Directory.Packages.props +++ b/dotnet/Directory.Packages.props @@ -27,10 +27,10 @@ - + - + @@ -45,7 +45,7 @@ - + @@ -120,7 +120,7 @@ - + diff --git a/dotnet/nuget.config b/dotnet/nuget.config index 128d95e590c..7e6c3f95369 100644 --- a/dotnet/nuget.config +++ b/dotnet/nuget.config @@ -3,10 +3,16 @@ + + + + + + diff --git a/dotnet/samples/02-agents/AgentProviders/foundry/Agent_Step25_FoundryToolboxMcp/Program.cs b/dotnet/samples/02-agents/AgentProviders/foundry/Agent_Step25_FoundryToolboxMcp/Program.cs index e611c345023..8dd3f55a8a1 100644 --- a/dotnet/samples/02-agents/AgentProviders/foundry/Agent_Step25_FoundryToolboxMcp/Program.cs +++ b/dotnet/samples/02-agents/AgentProviders/foundry/Agent_Step25_FoundryToolboxMcp/Program.cs @@ -90,7 +90,7 @@ static async Task CreateSampleToolboxAsync(string name, string endpoint, // Delete existing toolbox if present (ignore 404). try { - await toolboxClient.DeleteToolboxAsync(name); + await toolboxClient.DeleteAsync(name); Console.WriteLine($"Deleted existing toolbox '{name}'"); } catch (ClientResultException ex) when (ex.Status == 404) @@ -99,12 +99,13 @@ static async Task CreateSampleToolboxAsync(string name, string endpoint, } // Create a fresh version with a single MCP tool. - ProjectsAgentTool mcpTool = ProjectsAgentTool.AsProjectTool(ResponseTool.CreateMcpTool( - serverLabel: "api-specs", - serverUri: new Uri("https://gitmcp.io/Azure/azure-rest-api-specs"), - toolCallApprovalPolicy: new McpToolCallApprovalPolicy(GlobalMcpToolCallApprovalPolicy.NeverRequireApproval))); + MCPToolboxTool mcpTool = new("api-specs") + { + ServerUri = new Uri("https://gitmcp.io/Azure/azure-rest-api-specs"), + ToolCallApprovalPolicy = new McpToolCallApprovalPolicy(GlobalMcpToolCallApprovalPolicy.NeverRequireApproval), + }; - ToolboxVersion created = (await toolboxClient.CreateToolboxVersionAsync( + ToolboxVersion created = (await toolboxClient.CreateVersionAsync( name: name, tools: [mcpTool], description: "Sample toolbox with an MCP tool — created by Agent_Step25 sample.")).Value; diff --git a/dotnet/samples/03-workflows/Declarative/InvokeFoundryToolboxMcp/Program.cs b/dotnet/samples/03-workflows/Declarative/InvokeFoundryToolboxMcp/Program.cs index 6636cb13a7f..812d13cf7a2 100644 --- a/dotnet/samples/03-workflows/Declarative/InvokeFoundryToolboxMcp/Program.cs +++ b/dotnet/samples/03-workflows/Declarative/InvokeFoundryToolboxMcp/Program.cs @@ -155,7 +155,7 @@ private static async Task CreateSampleToolboxAsync(string name, string s try { - await toolboxClient.DeleteToolboxAsync(name); + await toolboxClient.DeleteAsync(name); Console.WriteLine($"Deleted existing toolbox '{name}'"); } catch (ClientResultException ex) when (ex.Status == 404) @@ -163,14 +163,15 @@ private static async Task CreateSampleToolboxAsync(string name, string s // Toolbox does not exist. } - ProjectsAgentTool webTool = ProjectsAgentTool.AsProjectTool(ResponseTool.CreateWebSearchTool()); + WebSearchToolboxTool webTool = new(); - ProjectsAgentTool mcpTool = ProjectsAgentTool.AsProjectTool(ResponseTool.CreateMcpTool( - serverLabel: serverLabel, - serverUri: new Uri("https://learn.microsoft.com/api/mcp"), - toolCallApprovalPolicy: new McpToolCallApprovalPolicy(GlobalMcpToolCallApprovalPolicy.NeverRequireApproval))); + MCPToolboxTool mcpTool = new(serverLabel) + { + ServerUri = new Uri("https://learn.microsoft.com/api/mcp"), + ToolCallApprovalPolicy = new McpToolCallApprovalPolicy(GlobalMcpToolCallApprovalPolicy.NeverRequireApproval), + }; - ToolboxVersion created = (await toolboxClient.CreateToolboxVersionAsync( + ToolboxVersion created = (await toolboxClient.CreateVersionAsync( name: name, tools: [webTool, mcpTool], description: "Sample toolbox combining Foundry web search with the Microsoft Learn MCP tools for the declarative InvokeFoundryToolboxMcp sample.")).Value; diff --git a/dotnet/tests/Foundry.Hosting.IntegrationTests/SessionFilesHostedAgentTests.cs b/dotnet/tests/Foundry.Hosting.IntegrationTests/SessionFilesHostedAgentTests.cs index 6ad017c51a5..b21059450f5 100644 --- a/dotnet/tests/Foundry.Hosting.IntegrationTests/SessionFilesHostedAgentTests.cs +++ b/dotnet/tests/Foundry.Hosting.IntegrationTests/SessionFilesHostedAgentTests.cs @@ -69,7 +69,6 @@ public async Task UploadedFile_IsReadByHostedAgentAsync() var adminOptions = new AgentAdministrationClientOptions(); adminOptions.AddPolicy(new FoundryFeaturesPolicy(HostedAgentsFeatureValue), PipelinePosition.PerCall); var adminClient = new AgentAdministrationClient(endpoint, credential, adminOptions); - var sessionFiles = adminClient.GetAgentSessionFiles(); // Build the per-agent OpenAI client. The conversation is created on this client so it is // bound to the agent endpoint URL (`/agents/{name}/endpoint/protocols/openai/conversations`). @@ -103,12 +102,13 @@ public async Task UploadedFile_IsReadByHostedAgentAsync() ?? throw new InvalidOperationException( $"Expected '{SessionIdHeader}' response header on warm-up but got none."); + // AgentSessionFiles is scoped to the (agent, session) pair at creation time. + var sessionFiles = adminClient.GetAgentSessionFiles(this._fixture.AgentName, agentSessionId); + try { // Step 3 — upload the file via the alpha AgentSessionFiles SDK to that exact session's $HOME. - SessionFileWriteResponse writeResponse = await sessionFiles.UploadSessionFileAsync( - agentName: this._fixture.AgentName, - sessionId: agentSessionId, + SessionFileWriteResponse writeResponse = await sessionFiles.UploadAsync( sessionStoragePath: TestDataFileName, localPath: localPath); @@ -116,12 +116,10 @@ public async Task UploadedFile_IsReadByHostedAgentAsync() Assert.Equal(expectedBytes, writeResponse.BytesWritten); bool foundEntry = false; - await foreach (SessionDirectoryEntry entry in sessionFiles.GetSessionFilesAsync( - agentName: this._fixture.AgentName, - agentSessionId: agentSessionId, + await foreach (SessionDirectoryEntry entry in sessionFiles.GetAllAsync( sessionStoragePath: ".")) { - if (entry.Name == TestDataFileName && !entry.IsDirectory && entry.Size == expectedBytes) + if (entry.Name == TestDataFileName && !entry.IsDirectory && entry.SizeInBytes == expectedBytes) { foundEntry = true; break; @@ -172,10 +170,8 @@ public async Task UploadedFile_IsReadByHostedAgentAsync() // the platform owns its lifecycle (no isolation key in our hands). try { - await sessionFiles.DeleteSessionFileAsync( - agentName: this._fixture.AgentName, - sessionId: agentSessionId, - path: TestDataFileName); + await sessionFiles.DeleteAsync( + localPath: TestDataFileName); } catch { From 4083505f57380c5023269070847f6cc188a61e6e Mon Sep 17 00:00:00 2001 From: Roger Barreto <19890735+RogerBarreto@users.noreply.github.com> Date: Mon, 29 Jun 2026 12:25:30 +0100 Subject: [PATCH 2/4] Use positional arg for AgentSessionFiles.DeleteAsync cleanup --- .../SessionFilesHostedAgentTests.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dotnet/tests/Foundry.Hosting.IntegrationTests/SessionFilesHostedAgentTests.cs b/dotnet/tests/Foundry.Hosting.IntegrationTests/SessionFilesHostedAgentTests.cs index b21059450f5..34e14c7e4fd 100644 --- a/dotnet/tests/Foundry.Hosting.IntegrationTests/SessionFilesHostedAgentTests.cs +++ b/dotnet/tests/Foundry.Hosting.IntegrationTests/SessionFilesHostedAgentTests.cs @@ -170,8 +170,7 @@ public async Task UploadedFile_IsReadByHostedAgentAsync() // the platform owns its lifecycle (no isolation key in our hands). try { - await sessionFiles.DeleteAsync( - localPath: TestDataFileName); + await sessionFiles.DeleteAsync(TestDataFileName); } catch { From db6e3c27c2db2b465134bde7744871f0da796e61 Mon Sep 17 00:00:00 2001 From: Roger Barreto <19890735+RogerBarreto@users.noreply.github.com> Date: Wed, 1 Jul 2026 10:35:04 +0100 Subject: [PATCH 3/4] Move to Azure.AI.Projects 2.1.0-beta.4 (released beta) Swaps the alpha daily build for the published 2.1.0-beta.4. Drops the azure-sdk public dev feed since beta.4 and its deps are on nuget.org. Beta.4 requires Azure.Core 1.60.0, which cascades the 10.0.8 servicing packages (Microsoft.Bcl.AsyncInterfaces, System.Diagnostics.DiagnosticSource, System.Text.Json, System.Threading.Channels, Microsoft.Extensions.DependencyInjection.Abstractions, Microsoft.Extensions.Logging.Abstractions) to 10.0.9. --- dotnet/Directory.Packages.props | 16 ++++++++-------- dotnet/nuget.config | 6 ------ 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/dotnet/Directory.Packages.props b/dotnet/Directory.Packages.props index d107e1b7c0a..e9917ef660f 100644 --- a/dotnet/Directory.Packages.props +++ b/dotnet/Directory.Packages.props @@ -27,10 +27,10 @@ - + - + @@ -42,19 +42,19 @@ - + - + - - + + @@ -87,12 +87,12 @@ - + - + diff --git a/dotnet/nuget.config b/dotnet/nuget.config index 7e6c3f95369..128d95e590c 100644 --- a/dotnet/nuget.config +++ b/dotnet/nuget.config @@ -3,16 +3,10 @@ - - - - - - From 5999c9ef679b083cabe38fcc680bd65d8997ed23 Mon Sep 17 00:00:00 2001 From: Roger Barreto <19890735+RogerBarreto@users.noreply.github.com> Date: Wed, 1 Jul 2026 13:59:45 +0100 Subject: [PATCH 4/4] Reconcile Azure.Core 1.60.0 bump with merged main Reverts the over-eager System.Threading.Channels 10.0.9 bump back to 10.0.8 (it was not part of the Azure.Core 1.60.0 cascade and caused a net472 MSB3277 conflict against the 10.0.8 that Microsoft.Extensions.AI pulls). Drops the now-obsolete Azure.Core VersionOverride=1.59.0 in HostedWorkflowHandoff (added on main to satisfy AgentServer while the central pin was lower); the central pin is now 1.60.0 which already satisfies the >=1.59.0 floor, and the override was downgrading this project below sibling projects (CS1705). --- dotnet/Directory.Packages.props | 2 +- .../Hosted-Workflow-Handoff/HostedWorkflowHandoff.csproj | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dotnet/Directory.Packages.props b/dotnet/Directory.Packages.props index c97348be485..93ec832a44f 100644 --- a/dotnet/Directory.Packages.props +++ b/dotnet/Directory.Packages.props @@ -54,7 +54,7 @@ - + diff --git a/dotnet/samples/04-hosting/FoundryHostedAgents/responses/Hosted-Workflow-Handoff/HostedWorkflowHandoff.csproj b/dotnet/samples/04-hosting/FoundryHostedAgents/responses/Hosted-Workflow-Handoff/HostedWorkflowHandoff.csproj index 2d913f0842f..2b0a0af8261 100644 --- a/dotnet/samples/04-hosting/FoundryHostedAgents/responses/Hosted-Workflow-Handoff/HostedWorkflowHandoff.csproj +++ b/dotnet/samples/04-hosting/FoundryHostedAgents/responses/Hosted-Workflow-Handoff/HostedWorkflowHandoff.csproj @@ -13,10 +13,10 @@ - - + +