-
Notifications
You must be signed in to change notification settings - Fork 295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] ManagedIdentityCredential throws OperationCanceledException when using SqlClient #1946
Comments
Hi @Rookian, thanks for bringing this issue to our attention. Microsoft.Data.SqlClient 4.1.0 has reached end of support as of Jan 29, 2023, you may want to consider upgrading to the latest LTS version i.e. 5.1.0, where it also upgrades the dependency for Azure Identity to 1.7.0 and soon 1.8.0 on our next release 5.2.0. As for exposing a timeout for ManagedIdentityCredentials from what I can tell from a brief look at the usage in ActiveDirectoryAuthenticationProvider, the ConnectionTimeout from the connection string seems to passed into token context, so perhaps, you can try increasing the |
Also, how long is |
Connection string: Command Timeout specified via code: builder.UseSqlServer(connectionString, x =>
{
x.CommandTimeout(60 * 1000);
x.EnableRetryOnFailure();
}); |
Hi @Rookian, I see that your sample code, you're using |
Hi @Rookian, did you get this issue resolved? I am also suffering such issue with latest MDS 5.2.0-preview5.24024.3. |
Library name and version
Azure.Identity 1.6.0, Microsoft.Data.SqlClient 4.1.0
Describe the bug
We receive almost everyday SqlExceptions with a inner OperationCanceledException.
Expected behavior
Clients might need to be able to increase the timeout or Microsoft should fix the endpoint that is responsible for providing an authentication token for
ManagedIdentityCredential
.Actual behavior
It seems like
SqlClient
tries to get a token fromManagedIdentityCredential
, but fails due to a timeout.Anything we can do here?
Reproduction Steps
Environment
Azure AppService (Linux)
.NET 6.0
See also
The text was updated successfully, but these errors were encountered: