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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
SuperUserLendl
Regular Visitor

Moving my Power BI embedded report from the sample application to my customer's application

I have the customer's application registered on Azure, and it is up and running being embedded to the sample application.  I am not a developer and cannot find step by step instructions of loading the report into an application other than the sample.  What do I need to do when I am actually on site with the customer and their website?

 

Do I enter their website information into my Visual Studio project and run it, if so, where?  Do I use the applications URL/URI?  Do I actually interject code into their application to accept / pull in the report?  

 

I understand the code below is used to load the report into a div container.  If someone could tell me exactly how to use this to go from the sample app to my customer's website it would make my week.  Where in the sample code do you associate the website to embed to?  How does the sample code even know to go to the sample application?

 

<script src="~/scripts/powerbi.js"></script>
<div id="reportContainer"></div>
<script>
// Read embed application token from Model
var accessToken = "@Model.EmbedToken.Token";

// Read embed URL from Model
var embedUrl = "@Html.Raw(Model.EmbedUrl)";

// Read report Id from Model
var embedReportId = "@Model.Id";

// Get models. models contains enums that can be used.
var models = window['powerbi-client'].models;

// Embed configuration used to describe what and how to embed.
// This object is used when calling powerbi.embed.
// This also includes settings and options such as filters.
// You can find more information at https://github.com/Microsoft/PowerBI-JavaScript/wiki/Embed-Configuration-Details.
var config = {
type: 'report',
tokenType: models.TokenType.Embed,
accessToken: accessToken,
embedUrl: embedUrl,
id: embedReportId,
permissions: models.Permissions.All,
settings: {
filterPaneEnabled: true,
navContentPaneEnabled: true
}
};

// Get a reference to the embedded report HTML element
var reportContainer = $('#reportContainer')[0];

// Embed the report and display it within the div container.
var report = powerbi.embed(reportContainer, config);
</script>

 

 

My embedded report in the sample appMy embedded report in the sample app

 

 

THANK YOU!

0 REPLIES 0

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.