<?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: Update Datasources REST API operation for live connections in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Update-Datasources-REST-API-operation-for-live-connections/m-p/846747#M21406</link>
    <description>&lt;P&gt;Sorry Greg, I did not. I'll let you know if I find a solution.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Alex&lt;/P&gt;</description>
    <pubDate>Fri, 15 Nov 2019 01:33:05 GMT</pubDate>
    <dc:creator>abernal</dc:creator>
    <dc:date>2019-11-15T01:33:05Z</dc:date>
    <item>
      <title>Update Datasources REST API operation for live connections</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Update-Datasources-REST-API-operation-for-live-connections/m-p/533002#M16358</link>
      <description>&lt;P&gt;I am trying to update&amp;nbsp;the connection string of a live connection power bi report published to the service. In order to do so, I am using the "&lt;SPAN&gt;Update Datasources In Group" datasets operation&amp;nbsp;of&amp;nbsp;the REST API.&amp;nbsp; I'm getting an "InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException" in the response. Is is possible to change connection strings of published Power BI reports in live connection mode? Below is&amp;nbsp; what I am trying to do and the response that I am getting... Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Request&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;$body = @" 
{ 
  "updateDetails":[ 
    { 
      "connectionDetails": 
      { 
        "server": "$($targetServer)", 
        "database": "$($targetDatabase)" 
      }, 
      "datasourceSelector": 
      { 
        "datasourceType": "$($datasourceType)", 
        "connectionDetails": 
        { 
          "server": "$($originalServer)", 
          "database": "$($originalDatabase)" 
        } 
      } 
    } 
  ] 
} 
"@

$uri = "https://api.powerbi.com/v1.0/$groupsPath/datasets/$datasetID/Default.UpdateDatasources"
Invoke-RestMethod -Uri $uri -Headers $authHeader -Method POST -Body $body&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Response&lt;/P&gt;&lt;P&gt;Invoke-RestMethod : The remote server returned an error: (400) Bad Request.&lt;BR /&gt;At H:\Projects\User Story 7483 - Infrastructure-Automated deployment of Power BI reports\20181003 Attempt\Change MOR Financial Report - Prod Orig to QA - Rest API.ps1:105 char:1&lt;BR /&gt;+ Invoke-RestMethod -Uri $uri -Headers $authHeader -Method POST -Body $ ...&lt;BR /&gt;+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;BR /&gt;+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException&lt;BR /&gt;+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand&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>Wed, 03 Oct 2018 22:04:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Update-Datasources-REST-API-operation-for-live-connections/m-p/533002#M16358</guid>
      <dc:creator>abernal</dc:creator>
      <dc:date>2018-10-03T22:04:34Z</dc:date>
    </item>
    <item>
      <title>Re: Update Datasources REST API operation for live connections</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Update-Datasources-REST-API-operation-for-live-connections/m-p/846509#M21403</link>
      <description>&lt;P&gt;Hi - did you ever resolve this?&amp;nbsp; I'm having same problem.&lt;/P&gt;&lt;P&gt;Wondering if you could share whatever you learned.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Greg&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2019 18:51:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Update-Datasources-REST-API-operation-for-live-connections/m-p/846509#M21403</guid>
      <dc:creator>orygreg2</dc:creator>
      <dc:date>2019-11-14T18:51:16Z</dc:date>
    </item>
    <item>
      <title>Re: Update Datasources REST API operation for live connections</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Update-Datasources-REST-API-operation-for-live-connections/m-p/846747#M21406</link>
      <description>&lt;P&gt;Sorry Greg, I did not. I'll let you know if I find a solution.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Alex&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2019 01:33:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Update-Datasources-REST-API-operation-for-live-connections/m-p/846747#M21406</guid>
      <dc:creator>abernal</dc:creator>
      <dc:date>2019-11-15T01:33:05Z</dc:date>
    </item>
    <item>
      <title>Re: Update Datasources REST API operation for live connections</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Update-Datasources-REST-API-operation-for-live-connections/m-p/911125#M22094</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am facing similar Issue, did you get solution for this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2020 18:04:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Update-Datasources-REST-API-operation-for-live-connections/m-p/911125#M22094</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-01-24T18:04:02Z</dc:date>
    </item>
    <item>
      <title>Re: Update Datasources REST API operation for live connections</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Update-Datasources-REST-API-operation-for-live-connections/m-p/1303967#M25313</link>
      <description>Hi, I had the same error when I tried updating a datasource server &amp;amp; database to the same value as now (even with difference in character case). Hence, resolved the issue by not doing such updates. Regards, Alex.</description>
      <pubDate>Tue, 18 Aug 2020 11:48:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Update-Datasources-REST-API-operation-for-live-connections/m-p/1303967#M25313</guid>
      <dc:creator>AlexMur</dc:creator>
      <dc:date>2020-08-18T11:48:47Z</dc:date>
    </item>
  </channel>
</rss>

