<?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: Problem in Update Datasource Power BI REST API Call in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Problem-in-Update-Datasource-Power-BI-REST-API-Call/m-p/3239452#M42707</link>
    <description>&lt;P&gt;I see. This means that with "credentialtype" Windows we are not allow to use the format above. Did you try with Basic Credentials?&amp;nbsp;&lt;A href="https://learn.microsoft.com/en-us/rest/api/power-bi/gateways/update-datasource#basic-credentials-example" target="_blank"&gt;https://learn.microsoft.com/en-us/rest/api/power-bi/gateways/update-datasource#basic-credentials-example&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 17 May 2023 05:57:09 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-05-17T05:57:09Z</dc:date>
    <item>
      <title>Problem in Update Datasource Power BI REST API Call</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Problem-in-Update-Datasource-Power-BI-REST-API-Call/m-p/3237488#M42684</link>
      <description>&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/rest/api/power-bi/gateways/update-datasource" target="_blank" rel="noopener"&gt;https://learn.microsoft.com/en-us/rest/api/power-bi/gateways/update-datasource&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The Power BI REST API call mentioned above is a PATCH request that is used to change/update the datasource credentials.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Request body is the &lt;SPAN&gt;credentialDetails, whose format is different for different credentials type.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;For basic credentials with username and password, it looks like the following -&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;{ &lt;SPAN class=""&gt;"credentialDetails"&lt;/SPAN&gt;: { &lt;SPAN class=""&gt;"credentialType"&lt;/SPAN&gt;: &lt;SPAN class=""&gt;"Basic"&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"credentials"&lt;/SPAN&gt;: &lt;SPAN class=""&gt;"{\"credentialData\":[{\"name\":\"username\", \"value\":\"john\"},{\"name\":\"password\", \"value\":\"*****\"}]}"&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"encryptedConnection"&lt;/SPAN&gt;: &lt;SPAN class=""&gt;"Encrypted"&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"encryptionAlgorithm"&lt;/SPAN&gt;: &lt;SPAN class=""&gt;"None"&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"privacyLevel"&lt;/SPAN&gt;: &lt;SPAN class=""&gt;"None"&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"useEndUserOAuth2Credentials"&lt;/SPAN&gt;: &lt;SPAN class=""&gt;"False"&lt;/SPAN&gt; } }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;For on-premise encrypted credentials -&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;{ &lt;SPAN class=""&gt;"credentialDetails"&lt;/SPAN&gt;: { &lt;SPAN class=""&gt;"credentialType"&lt;/SPAN&gt;: &lt;SPAN class=""&gt;"Windows"&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"credentials"&lt;/SPAN&gt;: &lt;SPAN class=""&gt;"AB....EF=="&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"encryptedConnection"&lt;/SPAN&gt;: &lt;SPAN class=""&gt;"Encrypted"&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"encryptionAlgorithm"&lt;/SPAN&gt;: &lt;SPAN class=""&gt;"RSA-OAEP"&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"privacyLevel"&lt;/SPAN&gt;: &lt;SPAN class=""&gt;"None"&lt;/SPAN&gt; } }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The problem I am facing is that the credentials I want to update is On-premise with "Windows" credential type with username and password. But I am not able to find the right json format for such a request. If anyone can help, please.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;LI-MESSAGE title="power BI rest API with python" uid="1953492" url="https://community.powerbi.com/t5/Desktop/power-BI-rest-API-with-python/m-p/1953492#U1953492" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-forum-thread lia-fa-icon lia-fa-forum lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&amp;nbsp;&lt;LI-MESSAGE title="Power BI REST API Update datasource credentials" uid="1198628" url="https://community.powerbi.com/t5/Developer/Power-BI-REST-API-Update-datasource-credentials/m-p/1198628#U1198628" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-forum-thread lia-fa-icon lia-fa-forum lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2023 10:05:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Problem-in-Update-Datasource-Power-BI-REST-API-Call/m-p/3237488#M42684</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-05-16T10:05:08Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in Update Datasource Power BI REST API Call</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Problem-in-Update-Datasource-Power-BI-REST-API-Call/m-p/3237926#M42693</link>
      <description>&lt;P&gt;Hey&amp;nbsp;@Anonymous&lt;/a&gt;&amp;nbsp;did you try to use the following format?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt; "credentials": "{\"credentialData\":[{\"name\":\"username\", \"value\":\"john\"},{\"name\":\"password\", \"value\":\"*****\"}]}"
&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know if this works:)&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2023 13:03:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Problem-in-Update-Datasource-Power-BI-REST-API-Call/m-p/3237926#M42693</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-05-16T13:03:12Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in Update Datasource Power BI REST API Call</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Problem-in-Update-Datasource-Power-BI-REST-API-Call/m-p/3239300#M42705</link>
      <description>&lt;P&gt;@Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried your format. It is not working. Gave an PrimitiveValue error. Then I tried the same format within curly brackets and I get the following error.&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;{
  &lt;SPAN class=""&gt;"error"&lt;/SPAN&gt;: {
    &lt;SPAN class=""&gt;"code"&lt;/SPAN&gt;: &lt;SPAN class=""&gt;"BadRequest"&lt;/SPAN&gt;,
    &lt;SPAN class=""&gt;"message"&lt;/SPAN&gt;: &lt;SPAN class=""&gt;"Bad Request"&lt;/SPAN&gt;,
    &lt;SPAN class=""&gt;"details"&lt;/SPAN&gt;: [
      {
        &lt;SPAN class=""&gt;"message"&lt;/SPAN&gt;: &lt;SPAN class=""&gt;"The property 'credentials' does not exist on type 'Microsoft.PowerBI.ServiceContracts.Api.GatewayDatasource'. Make sure to only use property names that are defined by the type."&lt;/SPAN&gt;,
        &lt;SPAN class=""&gt;"target"&lt;/SPAN&gt;: &lt;SPAN class=""&gt;"datasourceDelta"&lt;/SPAN&gt;
      }
    ]
  }
}&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2023 03:18:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Problem-in-Update-Datasource-Power-BI-REST-API-Call/m-p/3239300#M42705</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-05-17T03:18:44Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in Update Datasource Power BI REST API Call</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Problem-in-Update-Datasource-Power-BI-REST-API-Call/m-p/3239452#M42707</link>
      <description>&lt;P&gt;I see. This means that with "credentialtype" Windows we are not allow to use the format above. Did you try with Basic Credentials?&amp;nbsp;&lt;A href="https://learn.microsoft.com/en-us/rest/api/power-bi/gateways/update-datasource#basic-credentials-example" target="_blank"&gt;https://learn.microsoft.com/en-us/rest/api/power-bi/gateways/update-datasource#basic-credentials-example&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2023 05:57:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Problem-in-Update-Datasource-Power-BI-REST-API-Call/m-p/3239452#M42707</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-05-17T05:57:09Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in Update Datasource Power BI REST API Call</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Problem-in-Update-Datasource-Power-BI-REST-API-Call/m-p/3239491#M42709</link>
      <description>&lt;P&gt;@Anonymous&lt;/a&gt;&amp;nbsp; Yes I did. I tried various combinations too, it didn't work. But I learnt that we have to encrypt the Windows Username and password into a single string and use that as credential. So I am now trying to find the way to do that encryption in Python. (I made a new question)&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2023 06:24:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Problem-in-Update-Datasource-Power-BI-REST-API-Call/m-p/3239491#M42709</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-05-17T06:24:38Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in Update Datasource Power BI REST API Call</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Problem-in-Update-Datasource-Power-BI-REST-API-Call/m-p/3241650#M42725</link>
      <description>&lt;P&gt;I found the answer. For using WIndows credentials, first the credentials need to be encrypted to a credential string.&lt;/P&gt;&lt;P&gt;The python example is given here -&amp;nbsp;&lt;A href="https://github.com/microsoft/PowerBI-Developer-Samples/tree/master/Python/Encrypt%20credentials" target="_blank"&gt;https://github.com/microsoft/PowerBI-Developer-Samples/tree/master/Python/Encrypt%20credentials&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2023 06:46:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Problem-in-Update-Datasource-Power-BI-REST-API-Call/m-p/3241650#M42725</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-05-18T06:46:37Z</dc:date>
    </item>
  </channel>
</rss>

