Forum Discussion
Power BI API with service principal - 401 unauthorized
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.
Ah, you've been using a different API. Not sure that one would ever work. Heres the working oauth one I have:
- matoxin5 years agoFrequent Visitor
Thank you so much, this actually worked, I was finally able to generate a bearer token without any error messages.
The issue now is that whatever call I make using this token, I get the following error:
I tried finding more information about this and everything points to some issue with permissions, but I cannot figure out what's wrong (I have tested both non-admin and some of the supported admin calls). Please, do you have any idea what might be the problem?
UPDATE: some non-admin calls actually work, but I was not able to make any of the admin ones work properly. I have checked Azure again to make sure I have all the correct permissions assigned, and it seems to be the case:
Is anything missing?