The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event! Join us in Stockholm, Sweden from September 24-27, 2024.
2-for-1 sale on June 20 only!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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);
}
);
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.
How can i do ?
Thank you very much
Best regards
Solved! Go to Solution.
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
Proud to be a Super User!
My course: Introduction to Developing Power BI Visuals
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.
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
Proud to be a Super User!
My course: Introduction to Developing Power BI Visuals
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.
Do you prove chatgtp?
thanks for reply.
I try:
but i don't know how to set 'connect-src' in my files.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.