<?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: Pragmatically Change Datasets Data source Credential in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Pragmatically-Change-Datasets-Data-source-Credential/m-p/1193641#M24464</link>
    <description>&lt;P&gt;Have you tried this call?&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/updatedatasources" target="_blank"&gt;https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/updatedatasources&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 01 Jul 2020 01:20:50 GMT</pubDate>
    <dc:creator>lbendlin</dc:creator>
    <dc:date>2020-07-01T01:20:50Z</dc:date>
    <item>
      <title>Pragmatically Change Datasets Data source Credential</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Pragmatically-Change-Datasets-Data-source-Credential/m-p/1192521#M24458</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've publish a report into a workspace that we use for development.&amp;nbsp; To migrate the report from the Dev Worspace to an UAT one, I've build a PowerShell script that import the report.&amp;nbsp; In the script, I'm changing the database connection of the dataset to point to the UAT server and database using the report parameters (not a gateway).&amp;nbsp; The issue that I'm now facing is that I also need to change the data source credential of the dataset since the user that we use in UAT is not the same then Dev.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I change those information using the API or use User Id and User Password parameters ?&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jun 2020 14:20:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Pragmatically-Change-Datasets-Data-source-Credential/m-p/1192521#M24458</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-06-30T14:20:52Z</dc:date>
    </item>
    <item>
      <title>Re: Pragmatically Change Datasets Data source Credential</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Pragmatically-Change-Datasets-Data-source-Credential/m-p/1193641#M24464</link>
      <description>&lt;P&gt;Have you tried this call?&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/updatedatasources" target="_blank"&gt;https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/updatedatasources&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jul 2020 01:20:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Pragmatically-Change-Datasets-Data-source-Credential/m-p/1193641#M24464</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2020-07-01T01:20:50Z</dc:date>
    </item>
    <item>
      <title>Re: Pragmatically Change Datasets Data source Credential</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Pragmatically-Change-Datasets-Data-source-Credential/m-p/1197988#M24528</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I been able to change the data source credit using the UpdateDataSource API (&lt;A href="https://docs.microsoft.com/en-us/rest/api/power-bi/gateways/updatedatasource" target="_blank"&gt;https://docs.microsoft.com/en-us/rest/api/power-bi/gateways/updatedatasource).&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The trick is to use the Get Datasource (&lt;A href="https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/getdatasourcesingroup" target="_blank"&gt;https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/getdatasourcesingroup&lt;/A&gt;) before to retrieve the GatewayId and the DatasourceId link to the Dataset.&amp;nbsp; Even if you didn't declare a Gateway to your Dataset (For direct link to SQL Server in Azure), there is one created in the background and link to a Datasource.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, after calling the Get Datasource, I have all required information to call the UpdateDataSource and change the user Id and credential to connect to the new connection.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Issue solve.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jul 2020 12:46:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Pragmatically-Change-Datasets-Data-source-Credential/m-p/1197988#M24528</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-02T12:46:03Z</dc:date>
    </item>
  </channel>
</rss>

