Azure CLI authentication timed out

649 views Asked by At

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?

1

There are 1 answers

0
Robin On

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);