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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
umutgulac
Frequent Visitor

How to embed a PBI report into our web app where data is in SSAS

 

Under File directory, we couldnt find "Publish to Web" option. Is it because we prefered "online" connection option?

 

We try to get report from a web (php) application; as guided in this link

* We registered our app in Azure AD. We coded in our PHP webapp.

* We got the authorization code and acess token.

* We got the report list over PBI API with the response for report id and embed url.

 

We cannot fetch data from embed url. What may be the possible cause?

 

We also tried to test over here; but since we coulnt figure outthe embed code; we couldnt test over there? How to find the embed code?

1 REPLY 1
Eric_Zhang
Microsoft Employee
Microsoft Employee


@umutgulac wrote:

 

Under File directory, we couldnt find "Publish to Web" option. Is it because we prefered "online" connection option?

 

We try to get report from a web (php) application; as guided in this link

* We registered our app in Azure AD. We coded in our PHP webapp.

* We got the authorization code and acess token.

* We got the report list over PBI API with the response for report id and embed url.

 

We cannot fetch data from embed url. What may be the possible cause?

 

We also tried to test over here; but since we coulnt figure outthe embed code; we couldnt test over there? How to find the embed code?


@umutgulac

The here link is a demo of Power BI Javascript for Power BI Embedded. However you can still apply the Javascript API to embed the reports from Power BI Service in your case. Since you've figured out how to get the accesstoken and embed url, to embed a report with them, you can reference below html demo.

 

<html>

 <script src="https://microsoft.github.io/PowerBI-JavaScript/demo/node_modules/jquery/dist/jquery.js"></script>

<script src="https://microsoft.github.io/PowerBI-JavaScript/demo/node_modules/powerbi-client/dist/powerbi.js"></script>
 
<script type="text/javascript">
window.onload = function () {  
 

var embedConfiguration = {
    type: 'report',
	//replace your token here
    accessToken: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJ.................BwzM733Q',
	
	//replace your reportid here
	id: '057f230b-015e-4c86-ac98-55e82baf363a',
	//replace your embedUrl here
    embedUrl: 'https://app.powerbi.com/reportEmbed?reportId=057f230b-015e-4c86-ac98-55e82baf363a' 

}; 
 

var $reportContainer = $('#reportContainer');
 
var report = powerbi.embed($reportContainer.get(0), embedConfiguration);
 
}
</script>

<div id="reportContainer" ></div>

</html>

Helpful resources

Announcements
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 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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