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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
luojiandanPBI
Helper I
Helper I

Refused to connect to '......' because it violates the following Content Security Policy directive

hello everyone,

I need your help.

 

I use jQuery.js to get an *.json file,like this:

 

$.get("https://echarts.apache.org/examples/data/asset/geo/USA.json",
  function (json) {
     console.log('JSON Data:',json);
  }
);

 

luojiandanPBI_0-1697707613069.png

 

and I get error message in Web Console:

 

jquery.js:10099 Refused to connect to 'https://echarts.apache.org/examples/data/asset/geo/USA.json' because it violates the following Content Security Policy directive: "default-src https://app.powerbi.cn data: blob: 'unsafe-inline' 'unsafe-eval'". Note that 'connect-src' was not explicitly set, so 'default-src' is used as a fallback.

 

 luojiandanPBI_1-1697708139424.png

 

How can i do ? 

 

Thank you very much 

Best regards

2 ACCEPTED SOLUTIONS
dm-p
Super User
Super User

Hi @luojiandanPBI,

 

You will need to amend your privileges in your visual capabilities to allow web access from within the visual. Setting the domain you need should suffice, e.g.:

{
  ...
  "privileges": [
    {
      "name": "WebAccess",
      "essential": true,
      "parameters": [ "https://echarts.apache.org" ]
    }
  ],
  ...
}

 

This may not be exactly right but should help you move forward.

 

Note that the endpoint may have restrictions on accessing sandboxed iframes (which is how custom visuals are hosted). If this is the case, then you will need to check with the site owner if they can change their cross-domain policies (but bear in mind that site owners are usually reluctant to do this).

 

Regards,

 

Daniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




View solution in original post

Hi,Daniel,you are right.

github is ok.

"https://*.githubusercontent.com"

 

Thanks again.

View solution in original post

4 REPLIES 4
Brayancito2023
New Member

Do you prove chatgtp?

 

thanks for reply.

I try:

luojiandanPBI_0-1697769606400.png

but i don't know how to set 'connect-src' in my files.

dm-p
Super User
Super User

Hi @luojiandanPBI,

 

You will need to amend your privileges in your visual capabilities to allow web access from within the visual. Setting the domain you need should suffice, e.g.:

{
  ...
  "privileges": [
    {
      "name": "WebAccess",
      "essential": true,
      "parameters": [ "https://echarts.apache.org" ]
    }
  ],
  ...
}

 

This may not be exactly right but should help you move forward.

 

Note that the endpoint may have restrictions on accessing sandboxed iframes (which is how custom visuals are hosted). If this is the case, then you will need to check with the site owner if they can change their cross-domain policies (but bear in mind that site owners are usually reluctant to do this).

 

Regards,

 

Daniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




Hi,Daniel,you are right.

github is ok.

"https://*.githubusercontent.com"

 

Thanks again.

Helpful resources

Announcements
November Fabric Update Carousel

Fabric Monthly Update - November 2025

Check out the November 2025 Fabric update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Users online (27)