Azure / azure-storage-net

Microsoft Azure Storage Libraries for .NET

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DefaultAzureCredential failed to retrieve a token from the included credentials

vlkumarster opened this issue · comments

Which service(blob, file, queue, table) does this issue concern?

blob

Which version of the SDK was used?

WindowsAzure.Storage 9.3.3
Azure.Storage.Blobs 12.4.0
Azure.Identity 1.1.1

Which platform are you using? (ex: .NET Core 2.1)

Core 2.1

What problem was encountered?

Cant retrieve token using my default azure account which has storage.owner access on the resource.

How can we reproduce the problem in the simplest way?

https://docs.microsoft.com/en-us/azure/storage/common/storage-auth-aad-msi

Have you found a mitigation/solution?

approach specified in below article works fine.
https://joonasw.net/view/azure-ad-authentication-with-azure-storage-and-managed-service-identity

I encountered the exact same exception message when trying to use a managed identity to retrieve a KeyVault secret while debugging locally. I recently changed my password and had to re-login in Visual Studio to make it work again.

I encountered the exact same exception message when trying to use a managed identity to retrieve a KeyVault secret while debugging locally. I recently changed my password and had to re-login in Visual Studio to make it work again.

I had recently introduced Key Vault to our solution and an integration test that interacted with Azure Configuration Service suddenly started failing. Despite adding they Key Vault configuration to the ConfigurationBuilder setup, I was getting this error as well. Logging out and back in of Visual Studio resolved the issue for me and the test stopped throwing and passed again.