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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
rpalexf
Regular Visitor

CORS error when viewing Published PowerBI Report

Hi,


We are planning to embed PowerBI in an Angular2 app and have started publishing reports using the "Publish to Web" function.

When we load just the published url in the browser (eg. https://app.powerbi.com/view?r=eyJrIjoiM2QwOGU3YmMtMjlkNC....) we receive CORS errors in the browser.

 

The errors displayed are purely from the PowerBI site with no extra embedding used.

"XMLHttpRequest cannot load https://wabi-south-east-asia-redirect.analysis.windows.net/powerbi/metadata/models. Request header field X-PowerBI-ResourceKey is not allowed by Access-Control-Allow-Headers in preflight response."

These also occur multiple times after the load and sometimes causes the report to crash and then reload.

 

Is this an issue with the report or configuration we are using, or is this a known issue?

 

Thanks in advance for your time,

 

Alex

1 ACCEPTED SOLUTION

@rpalexf

 

Thanks for that clarification. I can verify that the url can be accessed from China and USA.
As I don't have much knowledge on CDN, I'd suggest you submit that issue and ask MS for support.

View solution in original post

3 REPLIES 3
Eric_Zhang
Employee
Employee

@rpalexf

 

I don't get that error when load the published url in a brower, could you try this url?

The eg url is truncated, please post the completed one so that I can test and try to reproduce the error.

Thanks for the reponse.

 

I just tried your url in my browser and I get a CORS error in your URL.

Failed to load resource: the server responded with a status of 404 (Resource Not Found)
XMLHttpRequest cannot load https://df-msit-scus-api.analysis.windows.net/powerbi/metadata/models. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://msit.powerbi.com' is therefore not allowed access. The response had HTTP status code 404.
Failed to load resource: the server responded with a status of 404 (Resource Not Found)
XMLHttpRequest cannot load https://df-msit-scus-api.analysis.windows.net/powerbi/metadata/models. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://msit.powerbi.com' is therefore not allowed access. The response had HTTP status code 404.
Failed to load resource: the server responded with a status of 404 (Resource Not Found)

 

I work in Australia, so maybe the CDN where the JS is hosted is not a trusted site for the .com domain.

But I cant be sure.

I also tested your URL in Edge and have the same issue.

 

Here is the stack track from Chrome;

ai.0.js:1 OPTIONS https://df-msit-scus-api.analysis.windows.net/powerbi/metadata/models XMLHttpRequest.send @ ai.0.js:1(anonymous function) @ powerbiportal.dependencies.bundle.min.js:115n @ powerbiportal.dependencies.bundle.min.js:111(anonymous function) @ powerbiportal.dependencies.bundle.min.js:108(anonymous function) @ powerbiportal.dependencies.bundle.min.js:143$eval @ powerbiportal.dependencies.bundle.min.js:157$digest @ powerbiportal.dependencies.bundle.min.js:154$apply @ powerbiportal.dependencies.bundle.min.js:158(anonymous function) @ powerbiportal.dependencies.bundle.min.js:171e @ powerbiportal.dependencies.bundle.min.js:57(anonymous function) @ powerbiportal.dependencies.bundle.min.js:60
view?r=eyJrIjoiNzAyMThlZGMtOTc4NS00YWM1LTkwOWYtYjYyNzVkZjdkODg2IiwidCI6IjcyZjk4OGJmLTg2ZjEtNDFhZi05…:1 XMLHttpRequest cannot load https://df-msit-scus-api.analysis.windows.net/powerbi/metadata/models. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://msit.powerbi.com' is therefore not allowed access. The response had HTTP status code 404.

 

Is there anything else I can try here?

 

Thanks again for your time,

 

Alex

@rpalexf

 

Thanks for that clarification. I can verify that the url can be accessed from China and USA.
As I don't have much knowledge on CDN, I'd suggest you submit that issue and ask MS for support.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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