Forum Discussion
Power BI REST API response 401
- 2 years ago
Hi,
the app registration does not need any permissions.
- To retrieve the token, you'd use the URL https://login.microsoftonline.com/{tenant ID}/oauth2/v2.0/token
- Did you add the app registration as workspace admin member in the workspace you specify?
- Is the app registration (service principal) allowed to connect in PowerBI tenant setting "Allow Service Principals to use PowerBI API "
- Also check that tenant setting "Dataset Execute Queries REST API" is enabled
I wrote just a similar article about it here, using the PowerBI API from ADF (but works teh same for Python, Postman, or other client) : Use Power BI APIs from Azure Data Factory - Mattias De Smet
Hi,
the app registration does not need any permissions.
- To retrieve the token, you'd use the URL https://login.microsoftonline.com/{tenant ID}/oauth2/v2.0/token
- Did you add the app registration as workspace admin member in the workspace you specify?
- Is the app registration (service principal) allowed to connect in PowerBI tenant setting "Allow Service Principals to use PowerBI API "
- Also check that tenant setting "Dataset Execute Queries REST API" is enabled
I wrote just a similar article about it here, using the PowerBI API from ADF (but works teh same for Python, Postman, or other client) : Use Power BI APIs from Azure Data Factory - Mattias De Smet
Hi mattiasdesmet , thank you for your reply. This is, I think, very helpful.
At this moment, I do not have access to the Power BI tenant settings. So bullet 3 & 4 will have to wait till I have the proper rights.
Regarding bullet 2, how do I add the app registration as workspace admin? I can only add users to the workspace, but no app registrations?
Thank you again!