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
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.
Solved! Go to Solution.
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:
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.
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:
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.
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).
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
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.