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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.