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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Marusyk
Helper II
Helper II

Embed for your customers doesn't work with warehouse

I'm trying to embed my simple Power BI report into my web application by using Microsoft.PowerBI.Api package for .NET. 

I'm using a service principal that has Admin rights in Microsoft Fabric workspace. The embedding token is returned successfully. But the data is not loaded

Marusyk_0-1734387577100.png

I found that there is 403Error which could be a problem

Marusyk_1-1734387626216.png

 

Could anyone help me to figure out what's wrong and how to fix that?

 

More details:

I'm using this code example to embed https://github.com/microsoft/PowerBI-Developer-Samples

Marusyk_0-1734387763422.png

 

 

4 REPLIES 4
lbendlin
Super User
Super User

Looks like a CORS issue - likely your app and the warehouse are in different locations ?

what do you mean? I try to run app on my local machine first to see the result and it doesn't work

 

for example, if I put an image in the report - I can see that image but the simple table with data from warehouse :

Marusyk_0-1734398026349.png

 

Hi @Marusyk ,

 

According to your screenshot, I think 403 forbidden is authorization error. 

Please make sure you have configured the service principal correctly.

You may refer to this offical blog:

Embed Power BI content in an embedded analytics application with service principal and an applicatio...

For more details about app owns data : Embed content in your Power BI embedded analytics application - Power BI | Microsoft Learn

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks for the info but I followed this guide and granted access to the service principal for all places where it is possible - it's an Admin for my workspace. I can get the report list in the code

`var embedToken = pbiClient.EmbedToken.GenerateToken(tokenRequest);`

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.