From e1e5100afe12fe955d30d24747b405984580ac19 Mon Sep 17 00:00:00 2001 From: Ben Thomas Date: Mon, 15 Sep 2025 09:55:28 -0700 Subject: [PATCH] Removing fallback to DefaultAzureCredential outside of testing. (#755) --- .../WorkflowAgentProvider.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dotnet/src/Microsoft.Agents.Workflows.Declarative/WorkflowAgentProvider.cs b/dotnet/src/Microsoft.Agents.Workflows.Declarative/WorkflowAgentProvider.cs index d1f75d6b5d..626811c786 100644 --- a/dotnet/src/Microsoft.Agents.Workflows.Declarative/WorkflowAgentProvider.cs +++ b/dotnet/src/Microsoft.Agents.Workflows.Declarative/WorkflowAgentProvider.cs @@ -6,7 +6,6 @@ using System.Threading.Tasks; using Azure.AI.Agents.Persistent; using Azure.Core; using Azure.Core.Pipeline; -using Azure.Identity; using Microsoft.Extensions.AI.Agents; namespace Microsoft.Agents.Workflows.Declarative; @@ -34,7 +33,7 @@ public abstract class WorkflowAgentProvider /// The endpoint URL of the Foundry project. This must be a valid, non-null URI pointing to the project. /// The credentials used to authenticate with the Foundry project. This must be a valid instance of . /// An optional instance to be used for making HTTP requests. If not provided, a default client will be used. -public sealed class FoundryAgentProvider(string projectEndpoint, TokenCredential? projectCredentials = null, HttpClient? httpClient = null) : WorkflowAgentProvider +public sealed class FoundryAgentProvider(string projectEndpoint, TokenCredential projectCredentials, HttpClient? httpClient = null) : WorkflowAgentProvider { private PersistentAgentsClient? _agentsClient; @@ -57,7 +56,7 @@ public sealed class FoundryAgentProvider(string projectEndpoint, TokenCredential clientOptions.Transport = new HttpClientTransport(httpClient); } - PersistentAgentsClient newClient = new(projectEndpoint, projectCredentials ?? new DefaultAzureCredential(), clientOptions); + PersistentAgentsClient newClient = new(projectEndpoint, projectCredentials, clientOptions); Interlocked.CompareExchange(ref this._agentsClient, newClient, null); }