How to Authenticate Azure service using managed Identity
Patil, Kiran
20
Reputation points
Hi Team,
I am trying to authenticate azure service with managed identity but it shows below error however all required accesses are given to identity.
Code -
string userAssignedClientId = "AAABBBBCCCC";
var defaultAzureCredentialOptions = new DefaultAzureCredentialOptions
{
ManagedIdentityClientId = userAssignedClientId,
ExcludeEnvironmentCredential = true,
ExcludeSharedTokenCacheCredential = true,
ExcludeVisualStudioCredential = true,
ExcludeAzureCliCredential = true,
ExcludeVisualStudioCodeCredential = true
};
var client = new ArmClient(new DefaultAzureCredential(defaultAzureCredentialOptions));
Error -
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
- 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
- ManagedIdentityCredential authentication unavailable. Multiple attempts failed to obtain a token from the managed identity endpoint.
- Az.Account module >= 2.2.0 is not installed.
- Azure Developer CLI could not be found.
Sign in to answer