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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
marcobaciga
Helper I
Helper I

Integration Power BI Desktop report to PHP application with PowerBI API

Hi,

is it possible integrate my php application a report or a tile powerbi using PowerBI API?

Can you put the php code to do its?

 

Thank you

 

Marco

1 ACCEPTED SOLUTION

Hi, i have tried this solution.

And when i run web site i receive a mistake.

Promise: not definited

 

in this part of code:

 

     var promise = new Promise(function (resolve, reject) {
                deferred.resolve = resolve;
                deferred.reject = reject;
            });
            deferred.promise = promise;
            return deferred;

 

what cani do?

 

Marco

 

View solution in original post

3 REPLIES 3
Eric_Zhang
Microsoft Employee
Microsoft Employee

@marcobaciga

The core of embedding Power BI reports is using a <iframe> tag in a HTML page, I think it won't be a problem in PHP.

 

<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',  
    accessToken: 'eyJ0eXAiOiYOUR-TOKEN-HERE-pgVRA',
    embedUrl: 'https://app.powerbi.com/reportEmbed?reportId=9f841c40-b361-490b-8f08-01dd2b8e6645'  
}; 

var $reportContainer = $('#reportContainer');
 
var report = powerbi.embed($reportContainer.get(0), embedConfiguration); 

} 

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

</html>  

The accessToken can be generated via ADAL for .NET, check this github page. As to how to get the accessToken in PHP, it is actually out of the topic of this forum. I'd suggest you post your question in dedeciated Azure AD forum.

Hi, i have tried this solution.

And when i run web site i receive a mistake.

Promise: not definited

 

in this part of code:

 

     var promise = new Promise(function (resolve, reject) {
                deferred.resolve = resolve;
                deferred.reject = reject;
            });
            deferred.promise = promise;
            return deferred;

 

what cani do?

 

Marco

 

Anonymous
Not applicable

Hello all,

I tried the code but receiving the error,require help on the same. 

 

Capture1.PNG

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.