Skip to content

[BUG] ClientOptions.Retry.NetworkTimeout is ignored #52672

@sergesh78

Description

@sergesh78

Library name and version

Azure.Identity 1.12.0

Describe the bug

Recentrly our application started to fail with exception:

Exception caught: Azure.Identity.CredentialUnavailableException: DefaultAzureCredential failed to retrieve a token from the included credentials. See the troubleshooting guide for more information. https://aka.ms/azsdk/net/identity/defaultazurecredential/troubleshoot
information. https://aka.ms/azsdk/net/identity/workloadidentitycredential/troubleshoot
- ManagedIdentityCredential authentication unavailable. No response received from the managed identity endpoint.

We tried increasing timeout and configuring retry option, but that didn't help:

SecretClientOptions opt = new SecretClientOptions();
opt.Retry.NetworkTimeout = TimeSpan.FromSeconds(30);

When debugging through the code I noticed that timeout is ignored and hard-coded value of 1 second is used

I also noticed that no retries are performed by SecretClient itself (log attached).

We will be implementing our own retry mechanism on top but really what we need is ability to configure retries and timeouts properly.

Expected behavior

Retry.NetworkTimeout should be used as actual timeout value

Actual behavior

hard-coded value of 1 sec is used and error message recommends configuring it via ClientOptions.Retry.NetworkTimeout which is not honored.

Reproduction Steps

SecretClientOptions opt = new SecretClientOptions();
opt.Retry.NetworkTimeout = TimeSpan.FromSeconds(30);
var client = new SecretClient(keyVaultUri, credentials, opt);
client.GetSecret("secretname");

Environment

Windows Server 2025 DataCenter, .net framework 4.8

Metadata

Metadata

Assignees

Labels

Azure.IdentityClientThis issue is related to a non-management packagecustomer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

Status

Untriaged

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions