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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
dpiret
Helper I
Helper I

Unauthorized (401) Embedded using the samples Node and .NET

Hi there.

 

When running the examples of embedded for your customers applications (both Node and .NET, I get this error (/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 ACCEPTED SOLUTION
dpiret
Helper I
Helper I

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.

 

View solution in original post

2 REPLIES 2
dpiret
Helper I
Helper I

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.

 

v-xulin-mstf
Community Support
Community Support

Hi @dpiret

 

Please refer to the links.

Troubleshoot your embedded application 

How to Fix a 401 Unauthorized Error 

Hope it helps!

If you still have some question, please don't hesitate to let me known.‌‌

 

Best Regards,

Link

 

Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution. Really appreciate!

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.