<?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: Set PowerBI datasource parameters programatically using PBI API in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Set-PowerBI-datasource-parameters-programatically-using-PBI-API/m-p/2065772#M31642</link>
    <description>&lt;P&gt;Hey Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;di you get this working? If yes please share how you got this done.&lt;/P&gt;</description>
    <pubDate>Thu, 09 Sep 2021 05:52:07 GMT</pubDate>
    <dc:creator>pbillava</dc:creator>
    <dc:date>2021-09-09T05:52:07Z</dc:date>
    <item>
      <title>Set PowerBI datasource parameters programatically using PBI API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Set-PowerBI-datasource-parameters-programatically-using-PBI-API/m-p/1589002#M27148</link>
      <description>&lt;P&gt;I would like to update my datasource credentials to AzureTable Storage.&lt;/P&gt;&lt;P&gt;To know how is the format of the credentials I maked a &lt;A href="https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/getdatasources" target="_self"&gt;Get datasources&lt;/A&gt; infos on an existing already linked dataset ( via power bi desktop )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{
"@odata.context": "http://wabi-west-europe-b-primary-redirect.analysis.windows.net/v1.0/myorg/groups/xxxxxxxxxxxxxxx/$metadata#datasources",
"value": [
{
"datasourceType": "AzureTables",
"connectionDetails": {
"account": "storageName",
"domain": "table.core.windows.net"
},
"datasourceId": "1a2bd852-8447-440b-b1c6-xxxxxxxxxx",
"gatewayId": "4aa719f9-565e-450b-b6a6xxxxxx"
}
]
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I tried to use the same structure to push a new dataset linked to this datasource using &lt;A href="https://docs.microsoft.com/en-us/rest/api/power-bi/pushdatasets/datasets_postdatasetingroup#datasetmode" target="_self"&gt;push API&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Here's my request body&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{
"name": "test",
"defaultMode": "Push",
"tables": [],
"datasources": 
{
"datasourceType": "AzureTables",
"connectionDetails": {
"account": "prodcallrecord",
"domain": "table.core.windows.net"
},
"datasourceId": "1a2bd852-8447-440b-b1c6-xxxxxxx",
"gatewayId": "4aa719f9-565e-450b-b6a6-xxxxxxxxx"
}

}&lt;/LI-CODE&gt;&lt;P&gt;Unfortunately I get this error&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
"error": {
"code": "InvalidRequest",
"message": "TOM deserialization failed for database sobe_wowvirtualserver|796c45fc-7f73-4711-a380-81465baedba7, Exception: &amp;lt;pi&amp;gt;Unrecognized JSON property: datasources. Check path 'datasources', line 1, position 60.&amp;lt;/pi&amp;gt;"
}
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't know where I've messed , is it because AzureTable is not supported from the PowerBi API ?&lt;/P&gt;&lt;P&gt;Is there another way to do this ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 10 Jan 2021 23:59:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Set-PowerBI-datasource-parameters-programatically-using-PBI-API/m-p/1589002#M27148</guid>
      <dc:creator>ITInge</dc:creator>
      <dc:date>2021-01-10T23:59:08Z</dc:date>
    </item>
    <item>
      <title>Re: Set PowerBI datasource parameters programatically using PBI API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Set-PowerBI-datasource-parameters-programatically-using-PBI-API/m-p/1590191#M27180</link>
      <description>&lt;P&gt;The Push API is not doing what you think it does. It is used for pushing data into streaming datasets.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need to use different API calls.&lt;/P&gt;
&lt;P&gt;Something like this:&amp;nbsp;&lt;A href="https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/updatedatasourcesingroup" target="_blank"&gt;Datasets - Update Datasources In Group (Power BI Power BI REST APIs) | Microsoft Docs&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jan 2021 19:12:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Set-PowerBI-datasource-parameters-programatically-using-PBI-API/m-p/1590191#M27180</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2021-01-11T19:12:27Z</dc:date>
    </item>
    <item>
      <title>Re: Set PowerBI datasource parameters programatically using PBI API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Set-PowerBI-datasource-parameters-programatically-using-PBI-API/m-p/1590208#M27181</link>
      <description>&lt;P&gt;Thanks for the reply , effectively I was trying to make update with this API today ,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;My actual issue is to use the right body params to update the datasource.&lt;BR /&gt;&lt;BR /&gt;Here's what the API preconize.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;"updateDetails": [ { "datasourceSelector": { "datasourceType": "Sql", "connectionDetails": { "server": "My-Sql-Server", "database": "My-Sql-Database" } }, "connectionDetails": { "server": "New-Sql-Server", "database": "New-Sql-Database" } },&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Here's what I'm sending&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I'm gettin 400 error&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{
   "updateDetails":[
      {
         "datasourceSelector":{
            "datasourceType":"AzureTables",
            "connectionDetails":{
               "account":"prodcallxxx",
               "domain":"table.core.windows.net"
            },
            "datasourceId":"2b23933c-34a7-4247-94ff-xxxxxx",
            "gatewayId":"d1e2a03c-0f55-42fe-b0dd-xxxxxxx"
         },
         "connectionDetails":{
            "account":"prodcallrecord",
            "domain":"table.core.windows.net"
         }
      }
   ]
}&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Error&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{
  "error": {
    "code": "InvalidRequest",
    "message": "Parameter UpdateDetails is missing or invalid"
  }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jan 2021 19:23:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Set-PowerBI-datasource-parameters-programatically-using-PBI-API/m-p/1590208#M27181</guid>
      <dc:creator>ITInge</dc:creator>
      <dc:date>2021-01-11T19:23:07Z</dc:date>
    </item>
    <item>
      <title>Re: Set PowerBI datasource parameters programatically using PBI API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Set-PowerBI-datasource-parameters-programatically-using-PBI-API/m-p/1590437#M27185</link>
      <description>&lt;P&gt;Use the sandbox (the "Try it!" button on the link I posted) to figure out the right parameters for your API call.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2021 00:12:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Set-PowerBI-datasource-parameters-programatically-using-PBI-API/m-p/1590437#M27185</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2021-01-12T00:12:48Z</dc:date>
    </item>
    <item>
      <title>Re: Set PowerBI datasource parameters programatically using PBI API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Set-PowerBI-datasource-parameters-programatically-using-PBI-API/m-p/1598273#M27233</link>
      <description>&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/265462"&gt;@ITInge&lt;/a&gt;,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;According to your error message, I think it means you are using the wrong update detailed in the rest API. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;For this scenario, I'd like to suggest you use 'Get Datasources In Group' API to get the detailed configurations and setting of your data source, then you can use them in update data source API:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;&lt;A href="https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/getdatasourcesingroup" target="_self"&gt;Datasets - Get Datasources In Group&lt;/A&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Regards,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Xiaoxin Sheng&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jan 2021 01:32:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Set-PowerBI-datasource-parameters-programatically-using-PBI-API/m-p/1598273#M27233</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-01-14T01:32:58Z</dc:date>
    </item>
    <item>
      <title>Re: Set PowerBI datasource parameters programatically using PBI API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Set-PowerBI-datasource-parameters-programatically-using-PBI-API/m-p/2065772#M31642</link>
      <description>&lt;P&gt;Hey Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;di you get this working? If yes please share how you got this done.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Sep 2021 05:52:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Set-PowerBI-datasource-parameters-programatically-using-PBI-API/m-p/2065772#M31642</guid>
      <dc:creator>pbillava</dc:creator>
      <dc:date>2021-09-09T05:52:07Z</dc:date>
    </item>
  </channel>
</rss>

