I have built a dashboard with Power BI desktop. It is possible to embed that dashboard into my localhost flask application? If yes how?
1 Answers
Yes, you can embed your power bi report in your flask web application. There are two methods to achieve this -
- Embedding for your organization - Reference link
- Embedding for your customers - Reference link
I will focus on the second method (it will require pro account):
Step 1: Register your power BI application here. Moreover, copy your application id.
Step 2: Then grant permissions to the application in azure portal.
Step 3: Collect the following variable details while performing the the above two steps -
- workspace id
- report id
- tenant id
- client id / application id (from step 1)
- power bi account username
- power bi account password
Step 4: You can use the sample flask web app provided by Microsoft for embedding.(Github link).
In this project you will have to provide the details (collected in step 3) in the file "config.py". However, this method requires a Pro license. The files that contain embedding code are in the folder Service and Models. The folder static and templates contains the front-end html and css code. Which you can always change as per your webpage, and the routes are managed in app.py
If you don't own a pro license then you can simply publish the report the on the web (which is not secure and everyone on the internet can view it). Then you will get an iframe code which you can inculcate in the html code of your flask web app (or any other web app).

- 96
- 7