Open 4865783a5d opened 1 month ago
Thank you for your feedback. Tagging and routing to the team member best able to assist.
Hi @4865783a5d -
Does the SQL Client ever successfully fetch a credential? Is the DevOps pipeline running on a default host or a custom host VM that you own with managed identity configured? Which credential were you expecting to be selected by DefaultAzureCredential
?
Hi @4865783a5d. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.
Hi @christothes, thanks for your reply.
Yes, an initial token can be fetched and we can successfully access the db during the initial access token duration. When the Azure Identity attempts to renew the token it fails.
Its a self hosted VM Scale Set running an Azure DevOps pipeline task. See the sample task posted above, all our builds use the Service Connection identity (Which is a federated auth ARM connection).
We run over 200 such build tasks (Eg. db migrations with federated auth service connections) on our private infrastructure with no issue if the task completes within 1 hour.
I'm happy to provide build logs over a private channel?
Unfortunately, using the connection string approach to using DefaultAzureCredential doesn't make it easy to enable our logging. Are you able to utilize it via the new AccessTokenCallback feature?
This would allow us to enable logging.
I'll try to setup a minimal reproducible sample with a simple C# Console App and the callback method. I'll get back to you with further details.
Hi @4865783a5d. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.
I'm on vacation, will provide a sample next week - sorry about the delay.
Hi @4865783a5d. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.
Library name and version
Azure.Identity 1.12.0 Microsoft.Data.SqlClient 5.1.5
Describe the bug
We have a long running Azure DevOps pipeline which imports data into a Azure Sql instance. After running for 1 hour, an access token refresh is attempted, which fails.
Expected behavior
A new access token is provisioned
Actual behavior
Reproduction Steps
Connection String:
Environment
Self-Hosted Build Agent, Ubuntu 20.04