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
Anonymous
Not applicable

PowerBIEmbed component not re-render when Embed token get refreshed

Hi experts: 

 

I am embedding a PowerBI report into the react app developed by my team, we use service principle as the user logged into our UI do not have to sign in Power BI to see the reports. We have registered an Azure AD app and added the service principle into the workspace. I have gone through https://docs.microsoft.com/en-us/power-bi/developer/embedded/embed-sample-for-customers?tabs=node-js and https://docs.microsoft.com/en-us/javascript/api/overview/powerbi/refresh-token, 

 

the way to get a new embed token in my application is when the embed token expired, the eventHandler will catch the error and get triggered, to get a new embed token; 

 

now I am able to generate a new embed token, and setAccessToken, however, the PowerBIEmbed component wont sense the change in useEffect() and not re-rendered. 

Could someone help on this? I also checked the development doc https://github.com/microsoft/powerbi-client-react/blob/master/demo/DemoApp.tsx, however, very limited example I could learn from, thanks a billion! 

2 REPLIES 2
v-yiruan-msft
Community Support
Community Support

Hi @Anonymous ,

Did you get any error message? Or you get only a blank page?

Embed Power BI content with service principal and an application secret

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi there: 

 

what I got after rendering the page is "this content is not available to view"; indicating the embed token is expired, meaning my refreshed token is not feed in into the useEffect hook. 

 

Is it possible I could schedule a support session with PowerBI developer and expand on this issue? This is time sensitive as we have a urgent deliverable by 07/14. 

 

Thanks for supporting! 

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!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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