Varsha Teckchandani
Varsha Teckchandani

Reputation: 33

Embed Power BI reports for customers with service principal

I am trying to follow the microsoft documentation step by step. After doing all the steps till Step-4, for my Step-5 which is actually embedding, I am using postman to make queries to the api.

My first query is to get access token which looks as follows:

enter image description here

Once I get the access token from this request, I use this access token as my bearer for authorization, to then get groups as follows

enter image description here

This request ends up giving me a 401 Unauthorized error. Any idea what am I doing wrong? Note that I registered my app already as mentioned in the step 1 of documentation here and followed each step exactly as stated. After that, I also delegated all permissions (just to make sure I don't miss out on anything) and also made sure to grant consent (Grant all permissions).

Upvotes: 0

Views: 551

Answers (1)

Priyanka2304
Priyanka2304

Reputation: 210

Usually you get a 401 Unauthorized error due to in-adequate Permission. Try below steps

  1. Register your App (Native or Web App) in Azure Active Directory under App Registrations. Or use the Power BI Developer Console to do that - Azure Active Directory Preferred
  2. Add the Power BI API to the registered app from Permissions Option. 3.Select and Delegate all the required permissions for the Power BI API 4.Most Important Grant All Permissions to the Registered App. If you don't have Admin Access to Azure Portal, you will not able able to grant the permissions

For more details visit this link.

Upvotes: 3

Related Questions