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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
hajarac
Regular Visitor

Power Bi rest Api

Hi! 

So I'm developing a modern web app using flask + Angular, and my backend (flask) is stateless.

I need to call some APIs in the backend like get reports, dashboards of a user ... is there any solution to this ?

- I tried to register the backend app in azure portal as a web app but the problem is that the login will be requested from the front and the redirect uri is on the backend + the backend is stateless so it was impossible to implement.

- Then I tried to register the frontend as an spa but the problem is that I need to process the data received from the requests in my backend app. 

 

Any solution to this situation please ??

Thank you in advance 

1 REPLY 1
Anonymous
Not applicable

Hi @hajarac ,

Please review the following links, hope they can help you...

Embed power bi dashboard into Flask Application

Yes, you can embed your power bi report in your flask web application. There are two methods to achieve this -

  1. Embedding for your organization - Reference link
  2. 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).


powerbi-embed-v2

Best Regards

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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