Hi @Saurav Likhar ,
The CredentialUnavailableError error typically means one of the following: the environment variables in your application are not correctly updated, your service principal does not have the correct secret permission, or in some cases Visual Studio may have lost its Azure Service Authentication connection.
Please confirm the following:
- Ensure that the environment variables are updated:
AZURE_CLIENT_ID
- service principal's app id
AZURE_TENANT_ID
- id of the principal's Azure Active Directory tenant
AZURE_CLIENT_SECRET
- one of the service principal's client secrets
- Ensure that the application is added to the Key Vault Access policies and that the resource has "Key Vault Secrets User" permissions.
- In Visual Studio, go to Tools > Options. Expand "Azure Service Authentication" > "Account Selection." If you see a "Reenter your credentials" link, click it and sign in again. If not, try a regular sign-out + sign-in via your Visual Studio profile in the top right.
Additional resources:
Azure error: DefaultAzureCredential authentication failed
Setting Azure EnvironmentCredential()
If these steps don't work, I would recommend checking in the internal Stack Overflow channel since I see that you are an internal FTE.
If the information helped you, please Accept the answer. This will help us and improve discoverability for others in the community who may be researching similar issues.