DefaultAzureCredential failed to retrieve a token

This post has been republished via RSS; it originally appeared at: New blog articles in Microsoft Tech Community.

If you try to retrieve a value from Azure Key Vault, you may run into this error: “DefaultAzureCredential failed to retrieve a token from the included credentials”.  




In order to solve this issue in a local machine:

  1. Add Active Directory app registration on Azure
  2. Create access policy for this app registration in Azure Key Vault settings
  3. Create environment variables for AZURE_CLIENT_ID, AZURE_CLIENT_SECRET, and AZURE_TENANT_ID (Reference)


To find out more about connecting an Azure VM to Key Vault, follow this tutorial. In a nutshell, you need to enable a managed identity for the VM and assign permissions to the identity.

REMEMBER: these articles are REPUBLISHED. Your best bet to get a reply is to follow the link at the top of the post to the ORIGINAL post! BUT you're more than welcome to start discussions here:

This site uses Akismet to reduce spam. Learn how your comment data is processed.