Robin
Robin

Reputation: 2308

Azure CLI authentication timed out

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

Answers (1)

Robin
Robin

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

Related Questions