Thank you for your post!
Error Message: Azure Key Vault REST API Error Codes 401
HTTP 401: Unauthenticated Request
From your error message, can you make sure that you sent the authentication token within your GET request? I'd also make sure that you can decode your token via https://jwt.ms
to ensure you have the correct tenant ID, client ID, and resource within your token.
I found some DefaultAzureCredential examples, that might help point you in the right direction. To create a new SecretClient
to create, get, update, or delete secrets, you need the endpoint to an Azure Key Vault and credentials. For more info - Creating a SecretClient.
var client = new SecretClient(new Uri(keyVaultUrl), new DefaultAzureCredential());
Additional Links:
- Authenticate with DefaultAzureCredential
- Exploring the sequence of DefaultAzureCredential authentication methods
- Common error codes for Azure Key Vault
I hope this helps!