I've written an ASP.NET Minimal API in .NET 9. I was fixing a bug yesterday. Once I fixed the bug, I tested it and it worked fine.
Now, I want to work on another bug, so I brought the API project up in VS 2026 and tried run it. This time it failed on a line in the Program.cs file, whcih I didn't even touch yesterday. Here's the line:
builder.Configuration.AddAzureKeyVault(
new Uri(vaultUri),
new DefaultAzureCredential());
The error it produced said, in part:
Azure.Identity.CredentialUnavailableException HResult=0x80131500 Message=DefaultAzureCredential failed to retrieve a token from the included credentials. See the troubleshooting guide for more information. https://aka.ms/azsdk/net/identity/defaultazurecredential/troubleshoot
Then at the end of the lengthy error message, it said:
Inner Exception 1: System.AggregateException: 'Multiple exceptions were encountered while attempting to authenticate. (EnvironmentCredential authentication unavailable. Environment variables are not fully configured. See the troubleshooting guide for more information. [https://aka.ms/azsdk/net/identity/environmentcredential/troubleshoot](https://aka%5C.ms/azsdk/net/identity/environmentcredential/troubleshoot%5C)) (WorkloadIdentityCredential authentication unavailable. The workload options are not fully configured. See the troubleshooting guide for more information. [https://aka.ms/azsdk/net/identity/workloadidentitycredential/troubleshoot](https://aka%5C.ms/azsdk/net/identity/workloadidentitycredential/troubleshoot%5C)) (ManagedIdentityCredential authentication unavailable. No response received from the managed identity endpoint.) (Process "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\Extensions\dmzzv0g5.xs4\TokenService\Microsoft.Asal.TokenService.exe" has failed with unexpected error: TS003: Error, TS004: Unable to get access token. 'AADSTS70043: The refresh token has expired or is invalid due to sign-in frequency checks by conditional access. The token was issued on 2026-10-01T19:07:28.9675360Z and the maximum allowed lifetime for this request is 604800. Trace ID: 2de28bdd-de3c-4957-9d76-3ff18d7f2100 Correlation ID: 93011fc4-1be4-4a49-9948-5e2e704ce80c Timestamp: 2026-10-08 20:18:03Z'.) (AzureCliCredential authentication failed: Azure CLI not installed) (AzurePowerShellCredential authentication failed: Az.Accounts module >= 2.2.0 is not installed.) (AzureDeveloperCliCredential authentication failed: Azure Developer CLI could not be found.)'
Inner Exception 2: Azure.Identity.CredentialUnavailableException: 'EnvironmentCredential authentication unavailable. Environment variables are not fully configured. See the troubleshooting guide for more information. https://aka.ms/azsdk/net/identity/environmentcredential/troubleshoot'
I don't understand why this ran fine yesterday, but today it's a problem.