[BUG] Creating two instances of DefaultAzureCredential causes requests using the credential to never complete #43796
Labels
Azure.Identity
Client
This issue points to a problem in the data-plane of the library.
needs-team-attention
Workflow: This issue needs attention from Azure service team or SDK team
Library name and version
Azure.Identity 1.11.0
Describe the bug
Calls to clients that accept
TokenCredential
as authentication will hang indefinitely, likeSecretClient.GetSecretAsync
. This only happens when creating multiple instances ofDefaultAzureCredential
the exact same way, using the same constructor and same parameters but passing each one to separate clients that acceptTokenCredential
.Expected behavior
Using multiple identical instances of
DefaultAzureCredential
will work the same with any client that accepts aTokenCredential
parameter for authentication regardless of call order/where the credentials are created.Actual behavior
Creating multiple identical instances of
DefaultAzureCredential
and passing them to multiple clients that acceptTokenCredential
for authentication will result in only the first client being able to resolve requests successfully.Reproduction Steps
The last line never completes. However, by changing either one of the credentials to pass in
new DefaultAzureCredentialOptions()
, the last line will now resolve successfully.This also happens even if different clients are used, like if the first client that's passed a
TokenCredential
isConfigurationClient
and the second isSecretClient
.Environment
.NET SDK:
Version: 8.0.204
Commit: c338c7548c
Workload version: 8.0.200-manifests.7d36c14f
Runtime Environment:
OS Name: Windows
OS Version: 10.0.22621
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\8.0.204\
The text was updated successfully, but these errors were encountered: