3
votes

I am trying to Embedding my Power Bi Reports in my MVC application using the following link https://docs.microsoft.com/en-us/power-bi/developer/embed-sample-for-customers and i am able to get the access_token but unable to retrieve the dashboards or reports based on Group Id because of 401 Unauthorized error.

Let me know what I am doing wrong.

2
It would be awesome if you could provide a minimal reproducible example.mjwills
Can you share the response body & headers for this error?RBreuer

2 Answers

4
votes

I faced the exact same issue during my Power BI Embedded implementation. The issue in my case was that adequate Permission were not granted for the registered app in Azure Active Directory. Please ensure you have performed the following 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. Added 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

More details can be found here.

0
votes

Another step that I also had to do for manually creating the security group, is to add the service principal (application in application registration) into the security group in Azure AD.

The PowerShell example does that for you, but the manual step does not describe it.