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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
wkmaylish
Frequent Visitor

Power BI API help

I am currently trying to get the Power BI API up and running for my company. I am working with our network team to create the app registration and am testing in postman. 

 

We create a Power Bi Service registered app with application permissions. This app is using a service account that is a Power Bi admin and the app has admin permissions at the moment. I am able to get the token but I am unable to make any calls with that token. They call come back with a 401 error.  Any pointers would be greatly appreciated. 

 

 

wkmaylish_0-1628258014875.png

wkmaylish_1-1628258140321.png

 

 

1 ACCEPTED SOLUTION
wkmaylish
Frequent Visitor

Just to update this item. We created a ticket with Microsoft to get some help. 

 

My API call in the screen shot was correct. We had some items in the admin side of Power BI we did not have setup. under the admin portal in Power BI, under Tenant Settings, make sure these options are turned on: 

wkmaylish_0-1630505207333.png

wkmaylish_1-1630505287062.png

 

Also, we still had issues even after turning these on. We ended up removing all permissions from the SP and adding Microsoft graph read all permissions even though the api documentation says tenant.readall.

 

This worked for us. I hope it might help someone else.

View solution in original post

4 REPLIES 4
wkmaylish
Frequent Visitor

Just to update this item. We created a ticket with Microsoft to get some help. 

 

My API call in the screen shot was correct. We had some items in the admin side of Power BI we did not have setup. under the admin portal in Power BI, under Tenant Settings, make sure these options are turned on: 

wkmaylish_0-1630505207333.png

wkmaylish_1-1630505287062.png

 

Also, we still had issues even after turning these on. We ended up removing all permissions from the SP and adding Microsoft graph read all permissions even though the api documentation says tenant.readall.

 

This worked for us. I hope it might help someone else.

msalerno
New Member

If you go to Azure Active Directory...

- Click App Registrations on the Left 

- Click the Application in the list that you are connecting to via using the client_credentials grant_type from your Postman image

- Click the API Permissions item on the left menu

- On this API Permissions page, check that you have "Grant admin consent for ..." enabled at the to of the list of scopes. 

- Also ensure that you have the required Power BI scopes added here

Looks like I am good in that area:

As of right now I am looking to export the activity log for long term reporting purposes and the permissions are set based off that (Tenant.Read.All)

 

 

wkmaylish_0-1628280332464.png

wkmaylish_1-1628280408743.png

 

 

Hi @wkmaylish ,

Did you want to get a list of audit activity events? You can refer the content in the following links to get it.

Getting Started with the New Power BI Activity Log API

Introducing the Power BI Activity Log

Intro to the Power BI Activity Log [with Olya M]

In addition, please review the reply of the following threads and check whether can resolve your problem.

Error accessing Power BI REST API: Admin - Get Activity Events using Service Principal auth

Power BI REST API - 401 Authorization error when using app secret/service principal (check the answer from @mkstr)

Best Regards

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

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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

Top Solution Authors