Unable to do certain PowerBI REST API Calls

Danny van Buren 16 Reputation points
2021-06-08T08:11:55.64+00:00

We are trying to use the PowerBI Rest API without users.

Mainly being able to refresh datasets during the ETL is the goal.

Now are we using Azure Data Factory as the application to do all the API Calls.

For this we have created an Application Registration as described by Microsoft.

Within this application we have granted the Service Principle Tenant.read.all and Tenant.ReadWrite.All permissions.

The datafactory is part of a Security group that has permissions to do API calls and that security group is a Admin of a particular workspace (test workspace).

Currently we are doing Web requests from Data factory to the Rest API endpoints using the managed identity from ADF as Authorization.

103343-image.png

This seemed to work because we could do some calls (GET Group and GET Datasets within group).

But when we try to do a call to get the data sources or refresh the dataset we are getting the error: "API is not accessible for application".

The PowerBI Rest API documentation defines which scopes are required for the different calls, but the scope for Get dataset is the same as the Get Datasource.
For the Refresh addiotional write permissions are needed (but should work i believe with Tenant.ReadWrite.All).

https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/refreshdataset

Also we have investigated the road as proposed in this blogpost but we would like to do it without the additional steps of getting a bearer token.

https://www.moderndata.ai/2019/05/powerbi-dataset-refresh-using-adf/

Any insights would be highly appriciated

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
9,603 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Danny van Buren 16 Reputation points
    2021-07-22T20:39:31.213+00:00

    We were able to solve this issue by using the API's where additional information about groups is necessary.
    In our case this didn't work : https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/refresh-dataset
    But this did: https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/refresh-dataset-in-group

    2 people found this answer helpful.