Forum Discussion
matoxin
5 years agoFrequent Visitor
Power BI API with service principal - 401 unauthorized
Hello everyone, recently I have been trying to make Power BI APIs work with service principal authentication. All steps mentioned in this article https://docs.microsoft.com/en-us/power-bi/develop...
matoxin
5 years agoFrequent Visitor
When I tried getting the token with the resource set to https://analysis.windows.net/powerbi/api/.default, it threw the following error:
The AAD security group (and also the service principal) has been added to the specific security group list in our Power BI workspace.
DavidCousinsT
Advocate I
5 years agoOh, that's easy then. Your POST is wrong. Didnt spot it the first time round because it was right at the top 😄 It must have the tenant ID in it, not 'common'
I use:
https://login.microsoftonline.com/[tenantid]/oauth2/v2.0/token/