Forum Discussion
API to Azure Purview
- Aug 18, 2022Difference for me using Piethein's excellent instructions was the change of resource from 'https://management.core.windows.net/' (getting that "Invalid token audience" error) to 'https://purview.azure.net'.
Hello everyone.
I was having this same issue in 2024:
Everytime I tried to get a response from the Purview REST API I was having this message:
{"error":{"code":"Unauthenticated","message":"Invalid token audience https://management.core.windows.net/. Valid audiences: 73c2949e-da2d-457a-9607-fcc665198967,https://purview.azure.net,https://purview.azure.net/"}}
At first I was filling the "resource" parameter with "https://purview.azure.net" in the token api call:
https://login.microsoftonline.com/{{your-tenant-id}}/oauth2/token
The solution I found was filling the "resource" parameter in the token call with 73c2949e-da2d-457a-9607-fcc665198967 which is the value I was getting in the previous response.
After this, the token was valid to make calls to the Purview REST API.