<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Getting Refused to connect to X because it violates the following Content Security Policy direct in Custom Visuals Development Discussion</title>
    <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Getting-Refused-to-connect-to-X-because-it-violates-the/m-p/3076489#M6855</link>
    <description>&lt;P&gt;I had the same problem.&lt;/P&gt;&lt;P&gt;In the end, what worked for me was changing the value of the visual's &lt;STRONG&gt;guid&lt;/STRONG&gt; in the file &lt;STRONG&gt;pbiviz.json&lt;/STRONG&gt;.&lt;/P&gt;</description>
    <pubDate>Sun, 12 Feb 2023 10:49:09 GMT</pubDate>
    <dc:creator>FelipeCosta</dc:creator>
    <dc:date>2023-02-12T10:49:09Z</dc:date>
    <item>
      <title>Getting Refused to connect to X because it violates the following Content Security Policy directive</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Getting-Refused-to-connect-to-X-because-it-violates-the/m-p/2904903#M6219</link>
      <description>&lt;P&gt;Dear community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On a custom visual I am trying use a http post request by fetch to a logic app endpoint, and getting following error from the Console:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Refused to connect to '&lt;A href="https://xxx.logic.azure.com/xxx" target="_blank" rel="noopener"&gt;https://xxx.logic.azure.com/xxx&lt;/A&gt;' because it violates the following Content Security Policy directive: "default-src 'self' data: blob: 'unsafe-inline' 'unsafe-eval'". Note that 'connect-src' was not explicitly set, so 'default-src' is used as a fallback.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Following is the code from the react component of the visual:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;handleClick&lt;/SPAN&gt;&lt;SPAN&gt; = () &lt;/SPAN&gt;&lt;SPAN&gt;=&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;fetch&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'&lt;A href="https://xxx.logic.azure.com:443/xxx" target="_blank" rel="noopener"&gt;https://xxx.logic.azure.com:443/xxx&lt;/A&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;, { &amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;method&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt; &lt;SPAN&gt;'POST'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;mode&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt; &lt;SPAN&gt;'cors'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;body&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt; &lt;SPAN&gt;JSON&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;stringify&lt;/SPAN&gt;&lt;SPAN&gt;({&lt;/SPAN&gt;&lt;SPAN&gt;"Data"&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;SPAN&gt;"Text1"&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt; &lt;SPAN&gt;"Test5"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"Text2"&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt; &lt;SPAN&gt;"Test6"&lt;/SPAN&gt;&lt;SPAN&gt;}}) &lt;/SPAN&gt;&lt;SPAN&gt;// body data type must match "Content-Type" header&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; })&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I have read up on CSP and best I could find was:&amp;nbsp;&lt;A href="https://learn.microsoft.com/en-us/power-bi/developer/visuals/capabilities#privileges-define-the-special-permissions-that-your-visual-requires" target="_blank" rel="noopener"&gt;https://learn.microsoft.com/en-us/power-bi/developer/visuals/capabilities#privileges-define-the-special-permissions-that-your-visual-requires&lt;/A&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;For which reason I have tried to add to capabiltities.json the following:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"privileges"&lt;/SPAN&gt;&lt;SPAN&gt;: [&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;"name"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;"WebAccess"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;"essential"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;true&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;"parameters"&lt;/SPAN&gt;&lt;SPAN&gt;: [ &lt;/SPAN&gt;&lt;SPAN&gt;"&lt;A href="https://prod-23.northeurope.logic.azure.com/" target="_blank" rel="noopener"&gt;https://prod-23.northeurope.logic.azure.com/&lt;/A&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"https://*.logic.azure.com/"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"&lt;A href="https://prod-23.northeurope.logic.azure.com:443/" target="_blank" rel="noopener"&gt;https://prod-23.northeurope.logic.azure.com:443/&lt;/A&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"*.logic.azure.com:443/"&lt;/SPAN&gt;&lt;SPAN&gt; ]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; },&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;"name"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;"ExportContent"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;"essential"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;true&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; ] &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Anyone got some ideas? Is it at all possible to do http request from a visual or has it been entirely blocked out by MS on the Power BI service?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Best regards and thanks&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 14 Nov 2022 23:37:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Getting-Refused-to-connect-to-X-because-it-violates-the/m-p/2904903#M6219</guid>
      <dc:creator>LasseL</dc:creator>
      <dc:date>2022-11-14T23:37:37Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Refused to connect to X because it violates the following Content Security Policy direct</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Getting-Refused-to-connect-to-X-because-it-violates-the/m-p/2908534#M6227</link>
      <description>&lt;P&gt;Hi again,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Doesn't seem to catch much traction this post.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the meantime, I have continued trying many different approaches; jquery, ajax, request header settings, response header settings, separating the call to another file etc., still same result.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently I am at this code in component.tsx:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LasseL_0-1668582513947.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/823832i73262AF9ABEC3575/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LasseL_0-1668582513947.png" alt="LasseL_0-1668582513947.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Providing following error in Console:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LasseL_2-1668582673055.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/823836i677AD68ABF631DB9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LasseL_2-1668582673055.png" alt="LasseL_2-1668582673055.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have set the response header in Logic Apps to the following, including access-control-allow-origin: *:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LasseL_4-1668582843728.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/823843i4791B60039907FD8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LasseL_4-1668582843728.png" alt="LasseL_4-1668582843728.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Picking up inspiration from another custom visual by acterys, I can see that they succeed on making use of http request from custom visual, and from the look of the response it seems to be a regular ajax request.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Meaning it IS posssible to make http request from custom visuals...? But what am I missing regarding CORS, headers, incompatible API using Logic Apps, CSP settings?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LasseL_3-1668582780085.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/823840i5BB23A340387407C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LasseL_3-1668582780085.png" alt="LasseL_3-1668582780085.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hoping someone in the community can help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Nov 2022 07:17:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Getting-Refused-to-connect-to-X-because-it-violates-the/m-p/2908534#M6227</guid>
      <dc:creator>LasseL</dc:creator>
      <dc:date>2022-11-16T07:17:09Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Refused to connect to X because it violates the following Content Security Policy direct</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Getting-Refused-to-connect-to-X-because-it-violates-the/m-p/2913430#M6237</link>
      <description>&lt;DIV&gt;&lt;SPAN&gt;I have found MS documentation that says changes have been made in API permissions and is now controlled by a object in the capabilities.json.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;However, I tried setting these, and they still make no difference:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;"privileges"&lt;/SPAN&gt;&lt;SPAN&gt;: [&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;"name"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;"WebAccess"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;"essential"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;true&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;"parameters"&lt;/SPAN&gt;&lt;SPAN&gt;: [&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;"&lt;A href="https://prod-23.northeurope.logic.azure.com/" target="_blank" rel="noopener nofollow noreferrer"&gt;https://prod-23.northeurope.logic.azure.com/xxx&lt;/A&gt;",&amp;nbsp;"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; },&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;"name"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;"ExportContent"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;"essential"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;true&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; ]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Also, I tried changing from Logic Apps as an API service to create a simple web api publised to App Services on Azure, and setting CORS to allow * - but same error regarding Refused ... CSP.&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LasseMr_0-1668706219759.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/825140iC7E1C10CF86AB8D4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LasseMr_0-1668706219759.png" alt="LasseMr_0-1668706219759.png" /&gt;&lt;/span&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas folks? Clearly it is possible to do perform API calls to external domains, what am I missing? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 17 Nov 2022 17:31:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Getting-Refused-to-connect-to-X-because-it-violates-the/m-p/2913430#M6237</guid>
      <dc:creator>LasseMr</dc:creator>
      <dc:date>2022-11-17T17:31:12Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Refused to connect to X because it violates the following Content Security Policy direct</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Getting-Refused-to-connect-to-X-because-it-violates-the/m-p/3014483#M6535</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/12580"&gt;@LasseL&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the exact same issue. Have you been able to find a solution to this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2023 16:42:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Getting-Refused-to-connect-to-X-because-it-violates-the/m-p/3014483#M6535</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-01-11T16:42:12Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Refused to connect to X because it violates the following Content Security Policy direct</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Getting-Refused-to-connect-to-X-because-it-violates-the/m-p/3023648#M6580</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;Having the same problem as well. Would love to know if you found a solution!&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jan 2023 15:35:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Getting-Refused-to-connect-to-X-because-it-violates-the/m-p/3023648#M6580</guid>
      <dc:creator>Fengshuki</dc:creator>
      <dc:date>2023-01-16T15:35:34Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Refused to connect to X because it violates the following Content Security Policy direct</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Getting-Refused-to-connect-to-X-because-it-violates-the/m-p/3045052#M6697</link>
      <description>&lt;P&gt;You got a 200 back. That's great.&lt;BR /&gt;So what exactly is your challenge?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The only think to do is to set the whitelisted web-urls in capabilities.json "&lt;SPAN&gt;privileges". Your own servers and all of the microsoft services as well.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2023 12:56:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Getting-Refused-to-connect-to-X-because-it-violates-the/m-p/3045052#M6697</guid>
      <dc:creator>pbn</dc:creator>
      <dc:date>2023-01-26T12:56:33Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Refused to connect to X because it violates the following Content Security Policy direct</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Getting-Refused-to-connect-to-X-because-it-violates-the/m-p/3048879#M6725</link>
      <description>&lt;P&gt;It seems that the error message is indicating that the browser is blocking the connection to the logic app endpoint due to a Content Security Policy (CSP) violation. CSP is a security feature that is implemented by the browser to prevent cross-site scripting (XSS) and other code injection attacks.&lt;/P&gt;</description>
      <pubDate>Sun, 29 Jan 2023 11:44:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Getting-Refused-to-connect-to-X-because-it-violates-the/m-p/3048879#M6725</guid>
      <dc:creator>Sahir_Maharaj</dc:creator>
      <dc:date>2023-01-29T11:44:27Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Refused to connect to X because it violates the following Content Security Policy direct</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Getting-Refused-to-connect-to-X-because-it-violates-the/m-p/3048880#M6726</link>
      <description>&lt;P&gt;The "default-src 'self' data: blob: 'unsafe-inline' 'unsafe-eval'" directive in the error message is the CSP policy that is being enforced by the browser, which means that the browser will only allow resources to be loaded from the same origin as the current page, data: and blob: URLs, and unsafe inline and eval scripts.&lt;/P&gt;</description>
      <pubDate>Sun, 29 Jan 2023 11:44:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Getting-Refused-to-connect-to-X-because-it-violates-the/m-p/3048880#M6726</guid>
      <dc:creator>Sahir_Maharaj</dc:creator>
      <dc:date>2023-01-29T11:44:39Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Refused to connect to X because it violates the following Content Security Policy direct</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Getting-Refused-to-connect-to-X-because-it-violates-the/m-p/3048881#M6727</link>
      <description>&lt;P&gt;Based on the code you've provided, it seems that you are trying to connect to an external endpoint (&lt;A href="https://xxx.logic.azure.com/" target="_new"&gt;https://xxx.logic.azure.com&lt;/A&gt;) that is not on the same origin as the current page. Therefore, the browser is blocking the connection.&lt;/P&gt;</description>
      <pubDate>Sun, 29 Jan 2023 11:45:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Getting-Refused-to-connect-to-X-because-it-violates-the/m-p/3048881#M6727</guid>
      <dc:creator>Sahir_Maharaj</dc:creator>
      <dc:date>2023-01-29T11:45:00Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Refused to connect to X because it violates the following Content Security Policy direct</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Getting-Refused-to-connect-to-X-because-it-violates-the/m-p/3048883#M6729</link>
      <description>&lt;P&gt;It is not possible to make HTTP requests from a Power BI visual to an external endpoint using the Fetch API. One workaround that you could use is to have a proxy server that relays the request from the visual to the external endpoint, and this way you can avoid the CSP issue.&lt;/P&gt;</description>
      <pubDate>Sun, 29 Jan 2023 11:45:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Getting-Refused-to-connect-to-X-because-it-violates-the/m-p/3048883#M6729</guid>
      <dc:creator>Sahir_Maharaj</dc:creator>
      <dc:date>2023-01-29T11:45:32Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Refused to connect to X because it violates the following Content Security Policy direct</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Getting-Refused-to-connect-to-X-because-it-violates-the/m-p/3048884#M6730</link>
      <description>&lt;P&gt;Alternatively, you can use Power Automate(MS Flow) or Azure Logic app to handle the request and return the response to Power BI visual.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 29 Jan 2023 11:45:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Getting-Refused-to-connect-to-X-because-it-violates-the/m-p/3048884#M6730</guid>
      <dc:creator>Sahir_Maharaj</dc:creator>
      <dc:date>2023-01-29T11:45:48Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Refused to connect to X because it violates the following Content Security Policy direct</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Getting-Refused-to-connect-to-X-because-it-violates-the/m-p/3049089#M6735</link>
      <description>&lt;P&gt;Here's a working code example. Working in all browsers and ios-App:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var xhr = new XMLHttpRequest();
            var _this = this.host;
            xhr.open("POST", "https://httpbin.org/post", true);
            xhr.setRequestHeader("Content-Type", "application/json");
            xhr.send(
              JSON.stringify({
                value: "Hello world",
              })
            );
            xhr.onload = function () {
              console.log(this.responseText);
              _this.displayWarningIcon(
                "Post-Request-Result",
                this.responseText
              );
            };&lt;/LI-CODE&gt;&lt;P&gt;capabilities.json&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;...    
"privileges": [{
            "name": "WebAccess",
            "essential": true,
            "parameters": [
                "https://httpbin.org/post", ...
	    ]
        },
...&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;HTH&lt;/P&gt;</description>
      <pubDate>Sun, 29 Jan 2023 20:16:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Getting-Refused-to-connect-to-X-because-it-violates-the/m-p/3049089#M6735</guid>
      <dc:creator>pbn</dc:creator>
      <dc:date>2023-01-29T20:16:57Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Refused to connect to X because it violates the following Content Security Policy direct</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Getting-Refused-to-connect-to-X-because-it-violates-the/m-p/3052511#M6747</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/504956"&gt;@pbn&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The 200 I got back was a test with another visual from appsource, demonstrating that it is indeed possible to use fetch requests within custom visuals and sandboxed iframe.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You are very right, it was just a question of getting the privileges set right it terms of whitelisting, when I got the servers in the requests went straight through!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks, I do not seem to find an actual answer that I can accept from you, can you provide one? &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have a great day.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jan 2023 11:49:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Getting-Refused-to-connect-to-X-because-it-violates-the/m-p/3052511#M6747</guid>
      <dc:creator>LasseMr</dc:creator>
      <dc:date>2023-01-31T11:49:20Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Refused to connect to X because it violates the following Content Security Policy direct</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Getting-Refused-to-connect-to-X-because-it-violates-the/m-p/3052513#M6748</link>
      <description>&lt;P&gt;See answer from&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/504956"&gt;@pbn&lt;/a&gt;&amp;nbsp;further below.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jan 2023 11:49:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Getting-Refused-to-connect-to-X-because-it-violates-the/m-p/3052513#M6748</guid>
      <dc:creator>LasseMr</dc:creator>
      <dc:date>2023-01-31T11:49:47Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Refused to connect to X because it violates the following Content Security Policy direct</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Getting-Refused-to-connect-to-X-because-it-violates-the/m-p/3052514#M6749</link>
      <description>&lt;P&gt;See answer from&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/504956"&gt;@pbn&lt;/a&gt;&amp;nbsp;further below.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jan 2023 11:49:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Getting-Refused-to-connect-to-X-because-it-violates-the/m-p/3052514#M6749</guid>
      <dc:creator>LasseMr</dc:creator>
      <dc:date>2023-01-31T11:49:56Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Refused to connect to X because it violates the following Content Security Policy direct</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Getting-Refused-to-connect-to-X-because-it-violates-the/m-p/3052517#M6750</link>
      <description>&lt;P&gt;Are you a chatbot? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know what the documentation says, that's already in my reference. However, it is possible to perform fetch requests - see further below and solution answer to my question by&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/504956"&gt;@pbn&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jan 2023 11:51:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Getting-Refused-to-connect-to-X-because-it-violates-the/m-p/3052517#M6750</guid>
      <dc:creator>LasseMr</dc:creator>
      <dc:date>2023-01-31T11:51:40Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Refused to connect to X because it violates the following Content Security Policy direct</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Getting-Refused-to-connect-to-X-because-it-violates-the/m-p/3052844#M6751</link>
      <description>&lt;P&gt;I really want to help you if I can. However, I don't understand your question. Where is your knowledge gap?&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jan 2023 14:09:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Getting-Refused-to-connect-to-X-because-it-violates-the/m-p/3052844#M6751</guid>
      <dc:creator>pbn</dc:creator>
      <dc:date>2023-01-31T14:09:22Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Refused to connect to X because it violates the following Content Security Policy direct</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Getting-Refused-to-connect-to-X-because-it-violates-the/m-p/3076256#M6854</link>
      <description>&lt;P&gt;Hi, thanks, but this didn't work. I still get the same error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did anyone manage to make it work?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Sat, 11 Feb 2023 21:32:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Getting-Refused-to-connect-to-X-because-it-violates-the/m-p/3076256#M6854</guid>
      <dc:creator>FelipeCosta</dc:creator>
      <dc:date>2023-02-11T21:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Refused to connect to X because it violates the following Content Security Policy direct</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Getting-Refused-to-connect-to-X-because-it-violates-the/m-p/3076489#M6855</link>
      <description>&lt;P&gt;I had the same problem.&lt;/P&gt;&lt;P&gt;In the end, what worked for me was changing the value of the visual's &lt;STRONG&gt;guid&lt;/STRONG&gt; in the file &lt;STRONG&gt;pbiviz.json&lt;/STRONG&gt;.&lt;/P&gt;</description>
      <pubDate>Sun, 12 Feb 2023 10:49:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Getting-Refused-to-connect-to-X-because-it-violates-the/m-p/3076489#M6855</guid>
      <dc:creator>FelipeCosta</dc:creator>
      <dc:date>2023-02-12T10:49:09Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Refused to connect to X because it violates the following Content Security Policy direct</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Getting-Refused-to-connect-to-X-because-it-violates-the/m-p/3108056#M6985</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am facing the same issue.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Passing the same Pbiviz code from 3.8.0 to 5.1.0 API version triggers the&amp;nbsp;&lt;SPAN&gt;Content-Security-Policy&lt;/SPAN&gt; 'connect-src' error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Setting the capabilities privilieges as following won't change anything :&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MaximeDelobelle_0-1677767884928.png" style="width: 248px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/880260i789A93401FEBD6D0/image-dimensions/248x125?v=v2" width="248" height="125" role="button" title="MaximeDelobelle_0-1677767884928.png" alt="MaximeDelobelle_0-1677767884928.png" /&gt;&lt;/span&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I even try to set the header meta content as following but it seems that the CSP policy is set above of the visual.&lt;/P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MaximeDelobelle_1-1677767967223.png" style="width: 612px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/880262i1BE4BF35CBB040E6/image-dimensions/612x71?v=v2" width="612" height="71" role="button" title="MaximeDelobelle_1-1677767967223.png" alt="MaximeDelobelle_1-1677767967223.png" /&gt;&lt;/span&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would appraciate some help if anyone has successfully access external Api ressources inside a PBI visual.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thnaks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maxime&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 02 Mar 2023 14:41:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Getting-Refused-to-connect-to-X-because-it-violates-the/m-p/3108056#M6985</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-03-02T14:41:31Z</dc:date>
    </item>
  </channel>
</rss>

