@Mark Robertson
Thank you for your post!
Based off your error message - Invalid audience. Expected https://vault.azure.net, found: 00000002-0000-0000-c000-000000000000
and issue description, it looks like you're using the correct scope of https://vault.azure.net/.default
. When calling the Get Secrets REST API from my Postman environment, I didn't run into any issues, but was able to re-produce a similar error message as yours.
Get Key Vault Access Token:
POST https://login.microsoftonline.com/{<!-- -->{tenantId}}/oauth2/v2.0/token
Scope - https://vault.azure.net/.default
Grant Type - client_credentials
Verify your Access Token:
Using https://jwt.ms/
-> Paste your Access Token into the "Enter Token Below" window. -> Confirm the audience is https://vault.azure.net
.
Get Secret:
GET https://<<Vaultname>>.vault.azure.net/secrets/testSecret?api-version=7.1
Header - `Key: Authorization // Value: Bearer <<access_token value>>
Note - I created a similar error message by using the scope management.azure.com rather than vault.azure.net.
I hope this helps!
If you have any other questions or are still having issues, 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.