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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register 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

 

 

Anonymous
Not applicable

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

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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