Reputation: 2308
I keep getting the message 'Azure CLI authentication timed out' when running Xunit tests using dotnet test. Does anyone know how to fix this issue?
Upvotes: 0
Views: 1476
Reputation: 2308
Try using the synchronous version of the Azure CLI authentication. In my case I was using this code:
var client = new SecretClient(new Uri(uri), new DefaultAzureCredential());
var secret = client.GetSecretAsync(key).Result;
I resolved the issue by changing the second line to this:
var secret = client.GetSecret(key);
Upvotes: 0