<?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 REST API: change PostgreSQL datasource database in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/REST-API-change-PostgreSQL-datasource-database/m-p/638736#M18720</link>
    <description>&lt;P&gt;Is there a way to use the REST API to change the PostgreSQL datasource, specifically, change its database and server address?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is what I am doing:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;I create a report in Power BI desktop, which imports data from a PostgreSQL datasource through an on-premised gateway.&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;I upload the pbix report to the Power BI cloud service using the REST API (for use in Power BI Embedded).&lt;/LI&gt;&lt;LI&gt;I now need to switch the database from a staging DB to the production DB&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;The&amp;nbsp;&lt;A href="https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/updatedatasourcesingroup" target="_self"&gt;Update Datasources In Group&lt;/A&gt; API documentation says that it can only be used with "SQL Server, Azure SQL Server, Analysis Services, Azure Analysis Services, OData Feed, and SharePoint datasources. For other datasource types, use Update Parameters In Group".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The aforementioned &lt;A href="https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/updateparametersingroup" target="_self"&gt;Update Parameters In Group&lt;/A&gt; API requires that "All parameters must exist in the dataset." However, my dataset does not have any parameters, as far as I can tell, so I get errors when I try to set any parameters:&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-center" image-alt="error.png" style="width: 600px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/150744iE53F73976CD0DCCA/image-size/large?v=v2&amp;amp;px=999" role="button" title="error.png" alt="error.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can see the connection details using the&amp;nbsp;&lt;A href="https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/getdatasourcesingroup" target="_self"&gt;Get Datasources In Group&lt;/A&gt; API (screenshot below). Is there any way to change them?&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-center" image-alt="datasource.PNG" style="width: 600px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/150743i08C43FAF15224E27/image-size/large?v=v2&amp;amp;px=999" role="button" title="datasource.PNG" alt="datasource.PNG" /&gt;&lt;/span&gt;&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;</description>
    <pubDate>Thu, 07 Mar 2019 01:34:58 GMT</pubDate>
    <dc:creator>sergei</dc:creator>
    <dc:date>2019-03-07T01:34:58Z</dc:date>
    <item>
      <title>REST API: change PostgreSQL datasource database</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/REST-API-change-PostgreSQL-datasource-database/m-p/638736#M18720</link>
      <description>&lt;P&gt;Is there a way to use the REST API to change the PostgreSQL datasource, specifically, change its database and server address?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is what I am doing:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;I create a report in Power BI desktop, which imports data from a PostgreSQL datasource through an on-premised gateway.&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;I upload the pbix report to the Power BI cloud service using the REST API (for use in Power BI Embedded).&lt;/LI&gt;&lt;LI&gt;I now need to switch the database from a staging DB to the production DB&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;The&amp;nbsp;&lt;A href="https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/updatedatasourcesingroup" target="_self"&gt;Update Datasources In Group&lt;/A&gt; API documentation says that it can only be used with "SQL Server, Azure SQL Server, Analysis Services, Azure Analysis Services, OData Feed, and SharePoint datasources. For other datasource types, use Update Parameters In Group".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The aforementioned &lt;A href="https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/updateparametersingroup" target="_self"&gt;Update Parameters In Group&lt;/A&gt; API requires that "All parameters must exist in the dataset." However, my dataset does not have any parameters, as far as I can tell, so I get errors when I try to set any parameters:&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-center" image-alt="error.png" style="width: 600px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/150744iE53F73976CD0DCCA/image-size/large?v=v2&amp;amp;px=999" role="button" title="error.png" alt="error.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can see the connection details using the&amp;nbsp;&lt;A href="https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/getdatasourcesingroup" target="_self"&gt;Get Datasources In Group&lt;/A&gt; API (screenshot below). Is there any way to change them?&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-center" image-alt="datasource.PNG" style="width: 600px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/150743i08C43FAF15224E27/image-size/large?v=v2&amp;amp;px=999" role="button" title="datasource.PNG" alt="datasource.PNG" /&gt;&lt;/span&gt;&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;</description>
      <pubDate>Thu, 07 Mar 2019 01:34:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/REST-API-change-PostgreSQL-datasource-database/m-p/638736#M18720</guid>
      <dc:creator>sergei</dc:creator>
      <dc:date>2019-03-07T01:34:58Z</dc:date>
    </item>
    <item>
      <title>Re: REST API: change PostgreSQL datasource database</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/REST-API-change-PostgreSQL-datasource-database/m-p/638801#M18721</link>
      <description>&lt;P&gt;I figured out an answer to my own question, and want to share it with anyone else who gets stuck on this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The &lt;A href="https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/updateparametersingroup" target="_self"&gt;Update Parameters In Group&lt;/A&gt; API call is the right approach. However, the dataset needs to be set up in advance to hold the database and server address in parameters, which can then be modified using the API.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To set up the data source with parameters, click Edit Queries within Power BI Desktop. There is an Edit Parameters option there. Create parameters with your connection info. Then, under&amp;nbsp;Edit Queries &amp;gt; Data source settings, Change the data source to use these parameters instead of explicitly specifying the connection strings. Here is a screenshot:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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-center" image-alt="params.PNG" style="width: 600px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/150760i2A140B40330B0639/image-size/large?v=v2&amp;amp;px=999" role="button" title="params.PNG" alt="params.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;</description>
      <pubDate>Thu, 07 Mar 2019 02:52:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/REST-API-change-PostgreSQL-datasource-database/m-p/638801#M18721</guid>
      <dc:creator>sergei</dc:creator>
      <dc:date>2019-03-07T02:52:12Z</dc:date>
    </item>
  </channel>
</rss>

