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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Alex2000
New Member

How to embed powerbi report when having "Cross-Origin-Embedder-Policy"

We are trying to embed a powerbi report in our website, but the call to https://app.powerbi.com being blocked by one of the security headers we have. Which is (Cross-Origin-Embedder-Policy) 
I was wondering if there's a way to solve this issue without removing this policy 

 

Thanks 

1 ACCEPTED SOLUTION
v-henryk-mstf
Community Support
Community Support

Hi @Alex2000 ,

 

According to your description, this is the browser part of the configuration.

vhenrykmstf_0-1658481481026.png

For more details, you can read related document.

Cross-Origin Embedder Policy - Report URI Documentation (report-uri.com)

Cross-Origin-Embedder-Policy - HTTP | MDN (mozilla.org)


If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.


Best Regards,
Henry


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
BamaGuy
New Member

In the event that anyone else experiences this and has the same issue - be sure that you are using an "Embed Token" with the PowerBI embed() function, not an access token - even though the field name is accessToken. The CORS error I was receiving was ultimately caused by using the wrong token.

v-henryk-mstf
Community Support
Community Support

Hi @Alex2000 ,

 

According to your description, this is the browser part of the configuration.

vhenrykmstf_0-1658481481026.png

For more details, you can read related document.

Cross-Origin Embedder Policy - Report URI Documentation (report-uri.com)

Cross-Origin-Embedder-Policy - HTTP | MDN (mozilla.org)


If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.


Best Regards,
Henry


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

This is not a solution at all.  If the answer is that there is no way to get the Power BI React examples working apart from localhost, or changing browser settings, then that library is essentially unusable.

Is there no way to allow specific sites for CORS access to your Power BI reports?  (this is a response header that Power BI has to set)  I'm hoping we are just missing something simple.

Try localhost but HTTPS, in IIS using self-sign cert.

Ran into the same issue. Should PowerBI not be including the Access-Control-Allow-Origin header to allow it to be embedded via CORS or similalry via a CORP policy? 


We are embedding PowerBI into a react app and followed this document: https://docs.microsoft.com/en-us/javascript/api/overview/powerbi/powerbi-client-react

Have you found any answers to this?  Seems to be lots of people with the question, but no answers at all.

Are the React-TS examples no longer valid?  (as they don't work except on localhost which is basically useless if it doesn't scale up to an actual production deployment)

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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