Forum Discussion

Vinnie's avatar
Vinnie
Helper I
2 years ago
Solved

Power BI REST API response 401

Hi all,   Hope you can help me with the following. I am trying to get a Python program to work which uses the Power BI API.   In Microsoft Entra ID I created an App. I have the client-id and clie...
  • mattiasdesmet's avatar
    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