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
tusharup
Regular Visitor

APP permissions for Power BI service and use API end points in JavaScript

Hello: 

I wanted to display powerBI reports to my public facing website. The users of the website will not have powerBI account. I plan to use powerBI pro account to get the Authentication Token and then embed the report in public facing website. 

So far I have done following stuff: \

1. I followed these step and register my app at powerBi. https://docs.microsoft.com/en-us/power-bi/developer/register-app

2. I received APP ID / Client ID.

3. Now I went to https://portal.azure.com/ , I see my app under Azure Active Directory=> App registrations.

4. I selected my app, and went to API permissions. Under the API permission, I see Azure Active Directory Graph already there. Also the permission selected for this is User.Read. 

5. I clicked, Add a permission button and added Power Bi Service, with Reports.Read.All and Reports.ReadWrite.All permission. 

6. Now I went back to Home and selected App registrations again, this will give me the list of all the registered APP including the one that I added in step # 1. 

7. Now I selected the APP that I created. It takes me to the below page (see image). There are various Quickstart guide for different technologies. It provides working application. guide.JPG

 

8. I used JS. It gave me SPA (Single Page Application) (see image above)

9. This SPA works good with Microsoft Graph API and list the login user info (https://graph.microsoft.com/v1.0/me)

10. It is giving me an error when, I am trying to use different end point (https://analysis.windows.net/powerbi/api) with scope value": ["Report.ReadWrite.All"]

 

ServerError: AADSTS650053: The application 'Demo' asked for scope 'Report.ReadWrite.All' that doesn't exist on the resource '00000003-0000-0000-c000-000000000000'. Contact the app vendor.

 

How to add API permission for Power Bi Service and use into JS to call the APIEndPoint (https://analysis.windows.net/powerbi/api)

 

Any idea/help would be greatly appreciated. 

 

Regards

 

2 REPLIES 2
Anonymous
Not applicable

Hi @Jayendran , i was trying out something similar. 

Screenshot 2021-05-21 at 3.29.49 PM.png

 But while trying to authenticate with Dataset scope, I get the following error. 

 

AADSTS650053: The application 'PowerBI Local' asked for scope 'Dataset.ReadWrite.All' that doesn't exist on the resource '00000003-0000-0000-c000-000000000000'. Contact the app vendor. Trace ID: 956f561d-a4bd-47f1-9710-9e3f6cd88c00 Correlation ID: f1f3aaac-552b-49b2-aecf-8666ebb29a34 Timestamp: 2021-05-21 09:49:37Z

 

Any idea what might be happening?

Jayendran
Solution Sage
Solution Sage

Hi @tusharup ,

 

You can add the API Permissions in the azure portal app registration page itself

 

Capture.JPG

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.