Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
DannyvB
New Member

Unable to do certain REST API Calls using Application

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.

DannyvB_0-1623072119237.png

 

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

- https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/getdatasets
https://docs.microsoft.com/en-us/rest/api/power-bi/groups/getgroups 

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".
- https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/getdatasources

 

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://docs.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

 

4 REPLIES 4
v-yetao1-msft
Community Support
Community Support

Hi @DannyvB 

Perhaps it is caused by the nature of the workspace.

Ailsamsft_0-1624351805527.png

As the solution for the case below

https://community.powerbi.com/t5/Service/Error-while-executing-Get-dataset-call-quot-API-is-not/m-p/...

 

Best Regards

Community Support Team _ Ailsa Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-yetao1-msft ,

 

Thanks for your Reply,

i have created a new Workspace to check if the workspace is the issue.

This unfortunatly doesn't seem the case.

I am still getting the API is not accessible for application.

 

On the Get dataset call everything goes okay, but datasources are unable to be retrieved.

v-yetao1-msft
Community Support
Community Support

Hi @DannyvB 

I found a similar problem, maybe you can refer to it .

https://community.powerbi.com/t5/Service/Error-while-executing-Get-dataset-call-quot-API-is-not/m-p/...

 

Best Regards

Community Support Team _ Ailsa Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-yetao1-msft,

 

Thanks for your Reply.

We are currently using the New Workspaces, so that seems okay.

The strange thing is that we can do a GET on the datasets within our workspace and get all datasets, but are not able to get the datasources from that particular dataset.

On the Site from Microsoft the permission scope for both API calls are the same, so it is unclear to me why we get that error. 

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors