<?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 Using Rest API to change a Report/Dataset to use a different On-Prem Enterprise Gateway in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Using-Rest-API-to-change-a-Report-Dataset-to-use-a-different-On/m-p/773087#M20487</link>
    <description>&lt;P&gt;I have a developed a PowerBI report in Powerbi desktop, which is sourcing it's data from an on-prem Analysis Server.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the&amp;nbsp; PowerBi service I have created a workspace, I have then installed a on-prem ( enterprise ) gateway, with a datasource which points to the same Analysis server,&lt;/P&gt;&lt;P&gt;when I publish my report from powerbi desktop it publishes into the workspace and automatically it is wired up to the gateway and all works good and well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOW!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using the PowerBI Restful API what I would like to do is take that same report&amp;nbsp; (pbix file ) and push it into a different workspace for which has a different on-prem gateway and datasource which points to our production Analysis Server, however I don't seem to be able to do this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tired the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Uploading the Pbix to the production workspace using the powerbi powershell commandlet: New-PowerBIReport&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This goes fine of course it's not wired up to anything which is expected.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I then trying to switch the gateway on the dataset for the report using this rest API call&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/bindtogatewayingroup" target="_blank" rel="noopener"&gt;https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/bindtogatewayingroup&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Specifying the GatewayID I want it to bind to and the Datasource Id of the production analysis server.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Which then comes back with a error saying: DMTS_CanNotFindMatchingDatasourceInGatewayError&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Which kind of makes sense because the report will be looking at the dev analysis server and that won't be configured on the prod gateway.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I thought I wonder if I could change that on the report&amp;nbsp; using the API, and I can by using:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/updatedatasourcesingroup" target="_blank" rel="noopener"&gt;https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/updatedatasourcesingroup&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So using this I'm able to change the database name and server from development to Production, and verify the service has picked up this change.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then I thought I could then call the bindtogatewayingroup and specify my production gateway and production datasource but it still fails with the same message.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After hours of research I'm coming to the conclusion that it's not possible to change a report from one gateway to another, unless the exact same data source exists on both gateways, which seems a bit pointless.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this a limitation of the API or am I doing something wrong???&lt;/P&gt;</description>
    <pubDate>Thu, 22 Aug 2019 12:55:11 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-08-22T12:55:11Z</dc:date>
    <item>
      <title>Using Rest API to change a Report/Dataset to use a different On-Prem Enterprise Gateway</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Using-Rest-API-to-change-a-Report-Dataset-to-use-a-different-On/m-p/773087#M20487</link>
      <description>&lt;P&gt;I have a developed a PowerBI report in Powerbi desktop, which is sourcing it's data from an on-prem Analysis Server.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the&amp;nbsp; PowerBi service I have created a workspace, I have then installed a on-prem ( enterprise ) gateway, with a datasource which points to the same Analysis server,&lt;/P&gt;&lt;P&gt;when I publish my report from powerbi desktop it publishes into the workspace and automatically it is wired up to the gateway and all works good and well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOW!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using the PowerBI Restful API what I would like to do is take that same report&amp;nbsp; (pbix file ) and push it into a different workspace for which has a different on-prem gateway and datasource which points to our production Analysis Server, however I don't seem to be able to do this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tired the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Uploading the Pbix to the production workspace using the powerbi powershell commandlet: New-PowerBIReport&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This goes fine of course it's not wired up to anything which is expected.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I then trying to switch the gateway on the dataset for the report using this rest API call&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/bindtogatewayingroup" target="_blank" rel="noopener"&gt;https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/bindtogatewayingroup&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Specifying the GatewayID I want it to bind to and the Datasource Id of the production analysis server.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Which then comes back with a error saying: DMTS_CanNotFindMatchingDatasourceInGatewayError&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Which kind of makes sense because the report will be looking at the dev analysis server and that won't be configured on the prod gateway.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I thought I wonder if I could change that on the report&amp;nbsp; using the API, and I can by using:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/updatedatasourcesingroup" target="_blank" rel="noopener"&gt;https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/updatedatasourcesingroup&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So using this I'm able to change the database name and server from development to Production, and verify the service has picked up this change.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then I thought I could then call the bindtogatewayingroup and specify my production gateway and production datasource but it still fails with the same message.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After hours of research I'm coming to the conclusion that it's not possible to change a report from one gateway to another, unless the exact same data source exists on both gateways, which seems a bit pointless.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this a limitation of the API or am I doing something wrong???&lt;/P&gt;</description>
      <pubDate>Thu, 22 Aug 2019 12:55:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Using-Rest-API-to-change-a-Report-Dataset-to-use-a-different-On/m-p/773087#M20487</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-22T12:55:11Z</dc:date>
    </item>
  </channel>
</rss>

