2

When running the examples of embedded for your customers applications (both Node and .NET), I get this error (in the console is coming from /getEmbedToken)

Status: Unauthorized (401)
Response: {"error":{"code":"PowerBINotAuthorizedException","pbi.error":{"code":"PowerBINotAuthorizedException","parameters":{},"details":[],"exceptionCulprit":1}}}
RequestId: fe5ca8dd-a49e-41b0-8f08-**********
  • The report I embedded is visible from Power BI service (app.powerbi.com)

I have tried:

  • Made sure config.json and web.config have the right information (clientId, reportId, tenantId, etc)
  • The authenticationMode is ServicePrincipal, and I'm using the credentials of the Global Admin (same user that created the dataset, report, has all permissions, is App Registration Owner, etc.)
  • All permissions granted on Power BI REST APIs on the App Registration
  • Workspace access is enabled
  • I'm using a Pro trial and have not used any developer tokens yet ("usage": 0)
  • The dataset is not requiring effective identity ("isEffectiveIdentityRequired": false)

Has anyone any clue of what else to check?

Thanks!

1
  • 1
    Check the license mode of the workspace - is it Pro, Premium per user, Premium per capacity or Embedded? See Assigning workspaces to capacities. Commented Aug 18, 2021 at 10:28

1 Answer 1

7

I found the problem. In case this happens to anybody, here's the solution:

The problem was in Step 7 - Enable workspace access that states Sign in to Power BI service > workspace you want to enable > Workspace access > Access pane, > copy the service principal to the Enter email address text box.

Because the email of the global admin was already filled out, I overlooked the actual requirement of entering the service principal ("Enter email address" was confusing).

The name of the service principal is the Display Name of the Azure AD app, as it appears in the Azure AD app's overview tab. This could also be a security group if you defined any.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.