Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowData Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more
Is it possible to embed a Power BI report in a php application. If so, how to generate access token and embed url using php?
Any help will be appreciated. Thank you in advance.
Solved! Go to Solution.
Hi @verma_pragya ,
There are a number of steps you need to take:
Now you should have a workspace id.
Now you should have a report id.
And now you should have a report in your app.
Reference: https://stackoverflow.com/questions/39770804/use-powerbi-embedded-in-php
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @verma_pragya ,
There are a number of steps you need to take:
Now you should have a workspace id.
Now you should have a report id.
And now you should have a report in your app.
Reference: https://stackoverflow.com/questions/39770804/use-powerbi-embedded-in-php
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Power BI Embedded (microsoft.com) You'll probably want to go with the JavaScript API. Do you have Azure AD?
Yes, I have Azure AD. I can embed a report using c# and python to generate the access token and embed URL, and javascript rest APIs to embed. However, I have no clue on how to generate access token using PHP, since I want to embed report in my PHP application.
I'm working on a similar problem...trying to embed for customers in Drupal. So far, my solution is to use the python (with flask) solution and potentially embed the flask service URL (localhost:5000 for now) in an iframe to serve the report. It works in my local Drupal instance. I'm working on how to pass the Drupal user id to the Javascript and then to the PowerBI API for row level security.
Good luck!!
Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.
Check out the May 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 |