Hi @Falanga, Rod, DOH , sorry about the editor. Our team is working on a fix.
The DefaultAzureCredential
class is designed to work with both Azure RBAC and Key Vault access policy. It tries multiple authentication methods in a certain order, and it falls back to the next method if the previous one fails. The authentication methods include environment variables, managed identity, Visual Studio, Azure CLI, and interactive browser login.
The error message "401 Unauthorized" usually indicates that the client is not authorized to access the Key Vault. This can happen if the client does not have the correct access policy or RBAC role assigned to it. Can you please check these troubleshooting steps and let me know if they resolve your issue?
- Check the access policy of the Key Vault to ensure that the client has the correct permissions to access the secrets. You can use the Azure portal or Azure CLI to check the access policy.
- Check the RBAC role of the client to ensure that it has the correct permissions to access the Key Vault. You can use the Azure portal or Azure CLI to check the RBAC role.
- Check the logs of the Key Vault to see if there are any error messages or warnings related to the client's access. You can use the Azure portal or Azure CLI to view the logs.
- Check the network connectivity between the client and the Key Vault to ensure that there are no firewall or network issues.
- Try to use a different authentication method with the
DefaultAzureCredential
class to see if it makes any difference. For example, you can try to use managed identity or Azure CLI instead of environment variables.
Please let me know if you have any questions and I can help you further.
If this answer helps you please mark "Accept Answer" so other users can reference it.
Thank you,
James