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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
MrRichDean
Regular Visitor

Calling Power BI API from Azure Logic App

Good morning / afternoon / evening

 

Would anyone be able to list the precise steps I need to perform in order to fire off a HTTP request to the Power BI api from within an azure logic app?

 

I have been attempting to follow the articles below:

 

https://carldesouza.com/how-to-register-an-azure-app-to-use-with-power-bi/

https://carldesouza.com/how-to-authenticate-and-use-the-power-bi-api-inside-power-automate/ 

 

To date, I haven't even got as far as to getting the access token and I am finding it rather infuriating!

 

Currently, I am stuck with the following error:

 

"error""invalid_grant",
"error_description""AADSTS65001: The user or administrator has not consented to use the application with ID
 
However, rather than looking at this specific error, I am thinking I may have to take a few steps back, hence my original question.
 
If anyone can point me in the right direction or give me some pointers, I'd be most grateful.
 
 
5 REPLIES 5
Anonymous
Not applicable

Hi @MrRichDean,

what kind of Power BI Rest API request are you using? If you want to use Admin API's with application your application has to have API permissions without Admin consent required option.

 

Marky_0-1650893187988.png

Instead of Yes in my picture you should have No.

 
lbendlin
Super User
Super User

the error message is pretty accurate. You first need to register the app, and make sure to specify the correct desired permission scope. Then your admin needs to agree to that app request.  Then you can use the app's authentication method to run your Power BI API calls.

Hello @lbendlin 

 

Could you explain what you mean regarding the correct desired permission scope? How does my admin agree to the app request? Am I even correct in that I need to get an access token before calling the Power BI API ?

 

Currently I am doing the following call to get the access token :

 

MrRichDean_0-1600091132155.png

MY admin believes they have agreed to eveything he can find - what are they missing?!

You went through here, right?

 

https://docs.microsoft.com/en-us/rest/api/power-bi/apps

 

Good morning @lbendlin 

 

I'm not 100% sure if my admin did this part of the process so I shall check with them and let this post know either way.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Kudoed Authors