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”.
Solution
In order to solve this issue in a local machine:
- Add Active Directory app registration on Azure
- Create access policy for this app registration in Azure Key Vault settings
- 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.
Updated Nov 09, 2023
Version 2.0Nedim
Former Employee
Joined November 26, 2018
IIS Support Blog
Follow this blog board to get notified when there's new activity