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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

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
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.

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.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

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.

Top Solution Authors