Why I am not able to read the keyvault through the .net application though
through Azure CLI command or powershell able to access the keyvault secret ?
Why I am not able to read the keyvault through the .net application though
through Azure CLI command or powershell able to access the keyvault secret ?
I get below error
"ManagedIdentityCredential authentication failed: Retry failed after 4 tries"
My UK dev team memebers have no issue with it, they are able to access it. Problem is with Mumbai dev team
Based on your error, you are using Managed Identity to access Key Vault. You need to make sure that the managed identity has been granted access to the Key Vault using either the access policies, or if you have updated your Key Vault to use Azure RBAC, the RBAC permissions.
Access policies seems ok to me as others are able to access same keyvault
I ensured that I am member of key vault, problem occurs when I Call Key Vault to get a secret below is examle of code
var client = new SecretClient(new Uri("https://testkeyvault0208.vault.azure.net/"), new DefaultAzureCredential());
KeyVaultSecret secret = client.GetSecret(keyName);
@RakeshYadav-3862
Thank you for your post and I apologize for the delayed response!
Based off your error message - "ManagedIdentityCredential authentication failed: Retry failed after 4 tries", I was able to find a similar issue on Stack Overflow that might help with troubleshooting this. If you're trying to use ManagedIdentityCredential on your local machine, this isn't supported.
For more details:
When using DefaultAzureCredential, web app tries to use ManagedIdentityCredential on local computer
Local development authentication
AppAuthentication to Azure.Identity Migration Guidance
DefaultAzureCredential.cs
If you have any other questions, please let me know.
Thank you for your time and patience throughout this issue.
Please remember to "Accept Answer" if any answer/reply helped, so that others in the community facing similar issues can easily find the solution.
12 people are following this question.
Will Microsoft see my keys in Azure Key Vault?
What are the different ways to authenticate to Azure Key Vault?
What are Azure Key Vault's soft-delete and purge protection features?
What is the limit of number of key vaults per subscription?
What is the difference between a key and a secret in Azure Key Vault?