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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Suvarchala7
Regular Visitor

Power Bi Integration in web app

Hi,

Can someone please help help in integrating power bi reports in reactjs app where users can directly view the report without asking for sign-in.

1 ACCEPTED SOLUTION

@Suvarchala7 
Please check with your internal Power BI admin team, if they are allowing 'Publish to web' option then you can generate an embed code and use it in your iframe. Generally large organisations disable this option. In that case if you want to embed youe report for your customers (who does not have a valid power bi license), your Power BI content should be in a embed capacity/Premium/Fabric capacity.  

View solution in original post

9 REPLIES 9
Suvarchala7
Regular Visitor

Hi @tharunkumarRTK 

 

We have tried this solution earlier. For access token you are using browser console and copying the token which only valids for 1 hours or less. As per my requirement I don't want access token to expire. I need a long lasting access token. Please help.

Suvarchala

@Suvarchala7 
As per my knowledge, embed token will have a validity of 1 hour. I would suggest you to follow the instructions here: https://learn.microsoft.com/en-us/power-bi/developer/embedded/embed-customer-app#step-1---configure-... to create an azure app registration and add the app into workspace and grant necessary permissions for embedding the reports. 

In your react app implement a section to generate a generate a new token: https://learn.microsoft.com/en-us/rest/api/power-bi/embed-token/generate-token every time a user access the application. This way you dont need to hard code the access token.


If the post helps please give a thumbs up


If it solves your issue, please accept it as the solution to help the other members find it more quickly.


Tharun


 

Hey, I am embedding power pi report in react, my problem is access token is expired in one hour I want to refresh this token after 45 minute using power bi APIs but I don't have azure aad how can I refresh my token without azure ad, i have my own server can I host my power bi report there, and use there APIs to refresh tokens and send any post method to power bi

@Shlokyy 
From what I understand, your report is in Power BI service. You cannot host one report in your server. If you want to host all your reports then you can use Power BI report server.


If the post helps please give a thumbs up


If it solves your issue, please accept it as the solution to help the other members find it more quickly.


Tharun



@tharunkumarRTK 

This solution is not working. Please help how to generate access token automatically for every 1hour else I have tried one more solution using iframe but when I embed report using iframe it is asking for sign-in on the application which is not needed. Looking forward for any kind of help.

@Suvarchala7 
Are you aware of the process of running a Power BI APIs? 
Embed Token API is no different

Hi @tharunkumarRTK 

We have our power BI reports in Pro License workspace. And in our react app we are logged in using microsoft. Even after using MSAL login our power bi reports which are embedded using iframe are asking for sign-in. Can this problem be solved if we take Premium license as I read it somewhere in microsoft documentation that Premium content has access to all users without sign-in

@Suvarchala7 
Please check with your internal Power BI admin team, if they are allowing 'Publish to web' option then you can generate an embed code and use it in your iframe. Generally large organisations disable this option. In that case if you want to embed youe report for your customers (who does not have a valid power bi license), your Power BI content should be in a embed capacity/Premium/Fabric capacity.  

tharunkumarRTK
Super User
Super User

@Suvarchala7 
You can check this video: https://www.youtube.com/watch?v=A5KFY5Jh1Uc 


If the post helps please give a thumbs up


If it solves your issue, please accept it as the solution to help the other members find it more quickly.


Tharun



Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.