<?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: Possible to update credentials via REST API? in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Possible-to-update-credentials-via-REST-API/m-p/139845#M4835</link>
    <description>&lt;P&gt;I am trying to reverse engineer what works in Power BI embedded and get it working in PowerBi.com. I have not found the secret to succsss yet, but I am getting closer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I ran the code that works for Power BI embedded and examine the calls with Fiddler. As you mentioned, there is a call to&amp;nbsp;&lt;SPAN&gt;&lt;STRONG&gt;Default.GetBoundGatewayDatasources&lt;/STRONG&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;/v1.0/collections/myWSC/workspaces/GUID-WS/datasets/GUID-DS/Default.GetBoundGatewayDatasources&lt;/PRE&gt;&lt;P&gt;The call to&amp;nbsp;Default.GetBoundGatewayDatasources&amp;nbsp;returns the following JSON.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;{  "value": [
    {
      "id": "bcb4e3d7-f906-4255-b3b6-60c94db791bb",
      "gatewayId": "7d8b1437-fbbc-44a4-84d8-9738eff0e176",
      "datasourceType": "Sql",
      "connectionDetails": "{\"server\":\"cpt.database.windows.net\",\"database\":\"wingtipsalesdb\"}"
    }
  ]
}&lt;/PRE&gt;&lt;P&gt;So far, so good. But then I tried&amp;nbsp;updating the data source credentials using&amp;nbsp;the datasource_id and the gateway_id. I changed the REST URL to a PowerBI.com URL shown here and executed&amp;nbsp;an&amp;nbsp;HTTP patch operation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;/v1.0/collections/myWSC/workspaces/GUID-WS/gateways/GUID-GW/datasources/GUID-DS&lt;/PRE&gt;&lt;P&gt;I passed the exact same JSON body as was passed in the Power BI embedde code .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;{
  "credentialType": "Basic",
  "basicCredentials": {
    "username": "CptStudent",
    "password": "pass@word1"
  }
}&lt;/PRE&gt;&lt;P&gt;When I try to make this call, I get the following error .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;{
  "error": {
    "code": "BadRequest",
    "message": "Bad Request",
    "details": [
      {
        "message": "'datasourceDelta' is a required parameter",
        "target": "datasourceDelta"
      }
    ]
  }
}&lt;/PRE&gt;&lt;P&gt;I am not exectly sure how to interpret this error, but it seems like the parameter named&amp;nbsp;&lt;STRONG&gt;datasourceDelta&lt;/STRONG&gt; needs to be added into the request body or into the URL.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Getting closer, but not there yet.&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, 09 Mar 2017 19:50:03 GMT</pubDate>
    <dc:creator>TedPattison</dc:creator>
    <dc:date>2017-03-09T19:50:03Z</dc:date>
    <item>
      <title>Possible to update credentials via REST API?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Possible-to-update-credentials-via-REST-API/m-p/137509#M4732</link>
      <description>&lt;P&gt;Does the current REST API support updating the data source credentials? I see that I'm able to update the connection string, but what about credentials? The only documentation I'm seeing is for credentials in a Data Gateway.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My main goal is to obfuscate the data source credentials from the end-user, and to deploy the .PBIX and all necessary connection information from the API.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Edit:&lt;/STRONG&gt; To add clarification, I am talking about the PowerBI.com REST API, not the Embedded API.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2017 15:52:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Possible-to-update-credentials-via-REST-API/m-p/137509#M4732</guid>
      <dc:creator>malagari</dc:creator>
      <dc:date>2017-03-09T15:52:06Z</dc:date>
    </item>
    <item>
      <title>Re: Possible to update credentials via REST API?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Possible-to-update-credentials-via-REST-API/m-p/138515#M4776</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/8585"&gt;@malagari&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;I've voted for &lt;A href="https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/18535039-update-credentials-of-dataset-using-api" target="_self"&gt;your idea&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Before I acutally did some research and thought I was close as I find this api &lt;A href="https://msdn.microsoft.com/en-us/library/mt732879.aspx" target="_self"&gt;Set Credentials&lt;/A&gt;. The datasource_id and gateway_id can be found via calling &lt;A href="https://msdn.microsoft.com/en-us/library/mt732874.aspx" target="_self"&gt;Get BoundGatewayDatasources&lt;/A&gt;. However when calling the Set Credential API, I've stuck by a &amp;nbsp;"DMTS_InvalidEncryptionAlgorithmError" error. I'm going to escalate this internally and will post back if there comes any update.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By the way, I don't find any API to create a data source for a dataset in a gateway, even though above two APIs work, We still need such an API otherwise we may have to configure the datasource manually.&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, 08 Mar 2017 07:29:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Possible-to-update-credentials-via-REST-API/m-p/138515#M4776</guid>
      <dc:creator>Eric_Zhang</dc:creator>
      <dc:date>2017-03-08T07:29:50Z</dc:date>
    </item>
    <item>
      <title>Re: Possible to update credentials via REST API?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Possible-to-update-credentials-via-REST-API/m-p/138903#M4800</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/6971"&gt;@Eric_Zhang&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for following up and voting for my idea. I really think this is crucial for the programmability of Power BI (and being able to control it completely through the API). &amp;nbsp;The Gateway API is close, but only works when using the On-premises Data Gateway. &amp;nbsp;I'm looking to be able to update the credentials / connection string of&amp;nbsp;&lt;EM&gt;any&lt;/EM&gt; data source.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I guess I'll have to keep an eye out for future updates.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2017 16:47:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Possible-to-update-credentials-via-REST-API/m-p/138903#M4800</guid>
      <dc:creator>malagari</dc:creator>
      <dc:date>2017-03-08T16:47:21Z</dc:date>
    </item>
    <item>
      <title>Re: Possible to update credentials via REST API?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Possible-to-update-credentials-via-REST-API/m-p/139083#M4803</link>
      <description>&lt;P&gt;Yes, I had to fight the code a bit but I got it working. This code allows me to update creds for connection to Azure SQL as required when doing DirectQuery.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;static void UpdateAzureSqlDataSource(string workspaceCollectionName, string workspaceId, string datasetId) {
  using (var client = CreatePowerBIClient()) {
    IList&amp;lt;Dataset&amp;gt; datasets = client.Datasets.GetDatasetsAsync(workspaceCollectionName, workspaceId).Result.Value;
    foreach (Dataset dataset in datasets) {
      if (dataset.Name == datasetId) {
        var datasources = client.Datasets.GetGatewayDatasourcesAsync(workspaceCollectionName, workspaceId, dataset.Id).Result;
        // Reset your connection credentials
        var delta = new GatewayDatasource {
          CredentialType = "Basic",
          BasicCredentials = new BasicCredentials {
            Username = azureSqlUser,
            Password = azureSqlPassword
          }
        };
        // Update the datasource with the specified credentials
        client.Gateways.PatchDatasourceAsync(workspaceCollectionName, 
                                              workspaceId, 
                                              datasources.Value[0].GatewayId, 
                                              datasources.Value[0].Id,
                                              delta).Wait();
      }
    }
  }
}&lt;/PRE&gt;&lt;P&gt;The complete sample program is up in a GitHub report at this URL:&lt;/P&gt;&lt;P&gt;&lt;A title="https://github.com/CriticalPathTraining/PowerBiEmbedded/blob/master/PBIEmbeddedDemo_Provisioning/PBIEmbeddedDemo_Provisioning/Program.cs" href="https://github.com/CriticalPathTraining/PowerBiEmbedded/blob/master/PBIEmbeddedDemo_Provisioning/PBIEmbeddedDemo_Provisioning/Program.cs" target="_self"&gt;https://github.com/CriticalPathTraining/PowerBiEmbedded/blob/master/PBIEmbeddedDemo_Provisioning/PBIEmbeddedDemo_Provisioning/Program.cs&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2017 21:13:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Possible-to-update-credentials-via-REST-API/m-p/139083#M4803</guid>
      <dc:creator>TedPattison</dc:creator>
      <dc:date>2017-03-08T21:13:51Z</dc:date>
    </item>
    <item>
      <title>Re: Possible to update credentials via REST API?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Possible-to-update-credentials-via-REST-API/m-p/139112#M4806</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/2834"&gt;@TedPattison&lt;/a&gt;&amp;nbsp;- interesting. Your code makes it seem as though you're just using the same exact call to update "Gateway" credentials for datasets. &amp;nbsp;Any idea.. is this strictly limited to DirectQuery still? &amp;nbsp;I'm hoping to use something similar for an Azure Analysis Services live connection.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2017 21:58:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Possible-to-update-credentials-via-REST-API/m-p/139112#M4806</guid>
      <dc:creator>malagari</dc:creator>
      <dc:date>2017-03-08T21:58:56Z</dc:date>
    </item>
    <item>
      <title>Re: Possible to update credentials via REST API?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Possible-to-update-credentials-via-REST-API/m-p/139150#M4807</link>
      <description>&lt;P&gt;I have used this code with imported datasets in Power BI as well as datasets that use DirectQuery against a Azure SQL database. When you have an imported dataset, you do not need to patch the data source credentials to make thing work at first because the data has already been imported into the Power BI cloud. Therefore, you only need to patch credentials for an imported datasets if you want to be able to refresh the dataset on demand or to schedule data refresh&amp;nbsp;inside the Power BI service. DirectQuery datasets do not have imported data so you have to patch credentials for them to work at all.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This code was a bit confusing to me at first because you have to create a new&amp;nbsp;GatewayDatasource object even when you are accessing an Azure SQL database without going through a Power BI Gateway.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My understanding is that this programming technique is also supposed to be used for datasets based on a live connections to a tabular database in Azure Ana;ysis Service. However, I have never tested it myself so I don't want to say it works until I have seen it work with my own eyes. I would love to hear from anyone in the Power BI community that has patched credentials to a Azure Analysis Services database.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2017 23:28:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Possible-to-update-credentials-via-REST-API/m-p/139150#M4807</guid>
      <dc:creator>TedPattison</dc:creator>
      <dc:date>2017-03-08T23:28:16Z</dc:date>
    </item>
    <item>
      <title>Re: Possible to update credentials via REST API?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Possible-to-update-credentials-via-REST-API/m-p/139183#M4809</link>
      <description>&lt;P&gt;Just have&amp;nbsp;you two synced up.&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/2834"&gt;@TedPattison&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;I think your code is for Power BI Embedded while I think&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/8585"&gt;@malagari&lt;/a&gt;&amp;nbsp;is looking for the REST API for Power BI Service.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2017 01:21:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Possible-to-update-credentials-via-REST-API/m-p/139183#M4809</guid>
      <dc:creator>Eric_Zhang</dc:creator>
      <dc:date>2017-03-09T01:21:29Z</dc:date>
    </item>
    <item>
      <title>Re: Possible to update credentials via REST API?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Possible-to-update-credentials-via-REST-API/m-p/139705#M4830</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/6971"&gt;@Eric_Zhang&lt;/a&gt;&amp;nbsp;is correct, I am looking at the Power BI.com API, not the PBI Embedded API. &amp;nbsp;While&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/2834"&gt;@TedPattison&lt;/a&gt;'s code doesn't answer my question directly, it does provide some insight into the classes under-the-hood.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm going to spend a little bit of time poking around either way.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2017 15:37:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Possible-to-update-credentials-via-REST-API/m-p/139705#M4830</guid>
      <dc:creator>malagari</dc:creator>
      <dc:date>2017-03-09T15:37:27Z</dc:date>
    </item>
    <item>
      <title>Re: Possible to update credentials via REST API?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Possible-to-update-credentials-via-REST-API/m-p/139845#M4835</link>
      <description>&lt;P&gt;I am trying to reverse engineer what works in Power BI embedded and get it working in PowerBi.com. I have not found the secret to succsss yet, but I am getting closer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I ran the code that works for Power BI embedded and examine the calls with Fiddler. As you mentioned, there is a call to&amp;nbsp;&lt;SPAN&gt;&lt;STRONG&gt;Default.GetBoundGatewayDatasources&lt;/STRONG&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;/v1.0/collections/myWSC/workspaces/GUID-WS/datasets/GUID-DS/Default.GetBoundGatewayDatasources&lt;/PRE&gt;&lt;P&gt;The call to&amp;nbsp;Default.GetBoundGatewayDatasources&amp;nbsp;returns the following JSON.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;{  "value": [
    {
      "id": "bcb4e3d7-f906-4255-b3b6-60c94db791bb",
      "gatewayId": "7d8b1437-fbbc-44a4-84d8-9738eff0e176",
      "datasourceType": "Sql",
      "connectionDetails": "{\"server\":\"cpt.database.windows.net\",\"database\":\"wingtipsalesdb\"}"
    }
  ]
}&lt;/PRE&gt;&lt;P&gt;So far, so good. But then I tried&amp;nbsp;updating the data source credentials using&amp;nbsp;the datasource_id and the gateway_id. I changed the REST URL to a PowerBI.com URL shown here and executed&amp;nbsp;an&amp;nbsp;HTTP patch operation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;/v1.0/collections/myWSC/workspaces/GUID-WS/gateways/GUID-GW/datasources/GUID-DS&lt;/PRE&gt;&lt;P&gt;I passed the exact same JSON body as was passed in the Power BI embedde code .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;{
  "credentialType": "Basic",
  "basicCredentials": {
    "username": "CptStudent",
    "password": "pass@word1"
  }
}&lt;/PRE&gt;&lt;P&gt;When I try to make this call, I get the following error .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;{
  "error": {
    "code": "BadRequest",
    "message": "Bad Request",
    "details": [
      {
        "message": "'datasourceDelta' is a required parameter",
        "target": "datasourceDelta"
      }
    ]
  }
}&lt;/PRE&gt;&lt;P&gt;I am not exectly sure how to interpret this error, but it seems like the parameter named&amp;nbsp;&lt;STRONG&gt;datasourceDelta&lt;/STRONG&gt; needs to be added into the request body or into the URL.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Getting closer, but not there yet.&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, 09 Mar 2017 19:50:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Possible-to-update-credentials-via-REST-API/m-p/139845#M4835</guid>
      <dc:creator>TedPattison</dc:creator>
      <dc:date>2017-03-09T19:50:03Z</dc:date>
    </item>
    <item>
      <title>Re: Possible to update credentials via REST API?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Possible-to-update-credentials-via-REST-API/m-p/139952#M4837</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/2834"&gt;@TedPattison&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;datasourceDelta &lt;/STRONG&gt;is where I've reached, then no further findings. It would be great if you could share any further findings, meanwhiling I'm trying to consult the product team.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Mar 2017 00:23:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Possible-to-update-credentials-via-REST-API/m-p/139952#M4837</guid>
      <dc:creator>Eric_Zhang</dc:creator>
      <dc:date>2017-03-10T00:23:33Z</dc:date>
    </item>
    <item>
      <title>Re: Possible to update credentials via REST API?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Possible-to-update-credentials-via-REST-API/m-p/142672#M4913</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@v-lvzhan-msft wrote:&lt;BR /&gt;&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/8585"&gt;@malagari&lt;/a&gt;&lt;/P&gt;&lt;P&gt;I've voted for &lt;A href="https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/18535039-update-credentials-of-dataset-using-api" target="_self"&gt;your idea&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Before I acutally did some research and thought I was close as I find this api &lt;A href="https://msdn.microsoft.com/en-us/library/mt732879.aspx" target="_self"&gt;Set Credentials&lt;/A&gt;. The datasource_id and gateway_id can be found via calling &lt;A href="https://msdn.microsoft.com/en-us/library/mt732874.aspx" target="_self"&gt;Get BoundGatewayDatasources&lt;/A&gt;. However when calling the Set Credential API, I've stuck by a &amp;nbsp;"DMTS_InvalidEncryptionAlgorithmError" error. I'm going to escalate this internally and will post back if there comes any update.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;By the way, I don't find any API to create a data source for a dataset in a gateway, even though above two APIs work, We still need such an API otherwise we may have to configure the datasource manually.&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;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/8585"&gt;@malagari&lt;/a&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/2834"&gt;@TedPattison&lt;/a&gt;&lt;/P&gt;&lt;P&gt;Here's the update from the Product team. The SET Credential API is for cloud datasources.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Based on my test, I can set credential with the API when the dataset is connecting to a Azure SQL database.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;to get&amp;nbsp;the Datasource and gateway id the user should use this API:&lt;/P&gt;&lt;P&gt;GET &lt;A href="https://api.powerbi.com/v1.0/myorg/datasets/%7Bdataset_id%7D/Default.GetBoundGatewayDataSources" target="_blank"&gt;&lt;SPAN&gt;https://api.powerbi.com/v1.0/myorg/datasets/{dataset_id}/Default.GetBoundGatewayDataSources&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and then to use the set credentials API.&lt;/P&gt;&lt;P&gt;PATCH &lt;A href="https://api.powerbi.com/v1.0/myorg/gateways/%7Bgateway_id%7D/datasources/%7Bdatasource_id" target="_blank"&gt;https://api.powerbi.com/v1.0/myorg/gateways/{gateway_id}/datasources/{datasource_id&lt;/A&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I thought the gateway_id in the PATCH API was an real &lt;A href="https://powerbi.microsoft.com/en-us/gateway/" target="_self"&gt;gateway&lt;/A&gt;. While I got the declarification&amp;nbsp;that&amp;nbsp;&lt;SPAN&gt;It's not a real GW in this case, but this is what the API refers to.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/8585"&gt;@malagari&lt;/a&gt;&lt;/P&gt;&lt;P&gt;So if you're using SQL Azure database, then I think you can&amp;nbsp;&lt;SPAN&gt;obfuscate the data source credentials from the end-user.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Mar 2017 02:46:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Possible-to-update-credentials-via-REST-API/m-p/142672#M4913</guid>
      <dc:creator>Eric_Zhang</dc:creator>
      <dc:date>2017-03-15T02:46:26Z</dc:date>
    </item>
    <item>
      <title>Re: Possible to update credentials via REST API?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Possible-to-update-credentials-via-REST-API/m-p/144002#M4943</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/6971"&gt;@Eric_Zhang&lt;/a&gt;. I'll give this a shot with Postman and see how it turns out.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2017 21:21:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Possible-to-update-credentials-via-REST-API/m-p/144002#M4943</guid>
      <dc:creator>malagari</dc:creator>
      <dc:date>2017-03-16T21:21:22Z</dc:date>
    </item>
    <item>
      <title>Re: Possible to update credentials via REST API?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Possible-to-update-credentials-via-REST-API/m-p/144471#M4967</link>
      <description>&lt;P&gt;After a few hours coding, I can say that I have succesffully written the code to patch credentials&amp;nbsp;for a SQL Azure dataset in PowerBI.com running in DirectQuery mode. I have posted a simple C# console application to use as a reference project at&amp;nbsp;&lt;A href="https://github.com/CriticalPathTraining/PbixInstallerForPowerBI" target="_self"&gt;https://github.com/CriticalPathTraining/PbixInstallerForPowerBI&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can see all the code required in a single C# file at &lt;A title="C# course code" href="https://github.com/CriticalPathTraining/PbixInstallerForPowerBI/blob/master/PbixInstallerForPowerBI/Program.cs" target="_self"&gt;here&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First, you need to retrieve the Gateway ID and the Datasource ID for the target dataset to be updated.&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-left" image-alt="fiddler1.png" style="width: 636px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/33504i9BA815016B275759/image-dimensions/636x250?v=v2" width="636" height="250" role="button" title="fiddler1.png" alt="fiddler1.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;&lt;P&gt;&amp;nbsp;&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;&lt;P&gt;&amp;nbsp;&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After that, you use the gateway id and the datasource ID to execute a HTTP&amp;nbsp;PATCH operation to update the credentials.&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-inline" image-alt="fiddler2.png" style="width: 600px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/33506iBBCAABD306CAEC82/image-size/large?v=v2&amp;amp;px=999" role="button" title="fiddler2.png" alt="fiddler2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After that, bob's your unkle and the DirectQuery report is able to connect to the SQL Azure database. For me,&amp;nbsp;the confusing part is that you must reference a gateway ID even though there isn't really a Power BI gateway invovled such as a personal gateway or the On-premises gateway. I guess it's a conceptual gateway. It's also a bit ironic that it doesn't work yet if an actual gateway is involved &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The unfortunate part about this is that there is a handy .NET API that wraps all these Power BI REST calls and makes it much easier to code. But this API only works for Power BI Embedded and not for PowerBI.com even though the underlying REST calls between&amp;nbsp;PowerBI.com and Power BI Embedded are almost identical. My guess is that Microsoft needed to get this API out the door in a hurry to give customers traction in getting started with Power BI Embedded. Hopefully, this Power BI .NET API will be modified in the future to use PowerBI.com workspaces in additon to Power BI Embedded worksspces. Until then we will have to write our code just as I have in the&amp;nbsp;&lt;STRONG&gt;PbixInstallerForPowerBI&lt;/STRONG&gt; reference application.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Mar 2017 15:11:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Possible-to-update-credentials-via-REST-API/m-p/144471#M4967</guid>
      <dc:creator>TedPattison</dc:creator>
      <dc:date>2017-03-17T15:11:24Z</dc:date>
    </item>
    <item>
      <title>Re: Possible to update credentials via REST API?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Possible-to-update-credentials-via-REST-API/m-p/225217#M7118</link>
      <description>&lt;P&gt;Is it possible to update the connection details via the patch web request?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Aug 2017 22:15:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Possible-to-update-credentials-via-REST-API/m-p/225217#M7118</guid>
      <dc:creator>Jeff_973</dc:creator>
      <dc:date>2017-08-03T22:15:41Z</dc:date>
    </item>
    <item>
      <title>Re: Possible to update credentials via REST API?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Possible-to-update-credentials-via-REST-API/m-p/492473#M15085</link>
      <description>&lt;P&gt;Update Power BI dataset Connection with Power BI Service.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;var error = GetWebConfigErrors();&lt;BR /&gt;if (error != null)&lt;BR /&gt;{&lt;BR /&gt;return View(new EmbedConfig()&lt;BR /&gt;{&lt;BR /&gt;ErrorMessage = error&lt;BR /&gt;});&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;// Create a user password cradentials.&lt;BR /&gt;var credential = new UserPasswordCredential(Username, Password);&lt;/P&gt;&lt;P&gt;// Authenticate using created credentials&lt;BR /&gt;var authenticationContext = new AuthenticationContext(AuthorityUrl);&lt;BR /&gt;var authenticationResult = await authenticationContext.AcquireTokenAsync(ResourceUrl, ClientId, credential);&lt;/P&gt;&lt;P&gt;if (authenticationResult == null)&lt;BR /&gt;{&lt;BR /&gt;return View(new EmbedConfig()&lt;BR /&gt;{&lt;BR /&gt;ErrorMessage = "Authentication Failed."&lt;BR /&gt;});&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;var tokenCredentials = new TokenCredentials(authenticationResult.AccessToken, "Bearer");&lt;/P&gt;&lt;P&gt;string connectionString = "&lt;SPAN&gt;"data source=MyServer.database.windows.net;initial catalog=MyDatabase;persist security info=True;encrypt=True;trustservercertificate=False"&lt;/SPAN&gt;";&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;// Create a Power BI Client object. It will be used to call Power BI APIs.&lt;BR /&gt;using (var client = new PowerBIClient(new Uri(ApiUrl), tokenCredentials))&lt;BR /&gt;{&lt;BR /&gt;// Get the newly created dataset from the previous import process&lt;BR /&gt;var datasets = await client.Datasets.GetDatasetsInGroupAsync(GroupId);&lt;/P&gt;&lt;P&gt;// Optionally udpate the connectionstring details if preent&lt;BR /&gt;if (!string.IsNullOrWhiteSpace(connectionString))&lt;BR /&gt;{&lt;BR /&gt;var connectionParameters = new ConnectionDetails&lt;BR /&gt;{&lt;BR /&gt;ConnectionString = connectionString&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;await client.Datasets.SetAllDatasetConnectionsInGroupAsync(GroupId, datasets.Value[0].Id, connectionParameters);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;// Get the datasources from the dataset&lt;BR /&gt;var datasources = await client.Datasets.GetGatewayDatasourcesAsync(GroupId, datasets.Value[0].Id);&lt;/P&gt;&lt;P&gt;// Reset your connection credentials&lt;BR /&gt;var delta = new UpdateDatasourceRequest&lt;BR /&gt;{&lt;BR /&gt;CredentialDetails = new CredentialDetails&lt;BR /&gt;{&lt;BR /&gt;CredentialType = "Basic",&lt;BR /&gt;Credentials = "{\"credentialData\":[{\"name\":\"username\", \"value\":\"anuj\"},{\"name\":\"password\", \"value\":\"******\"}]}",&lt;BR /&gt;EncryptedConnection = "Encrypted",&lt;BR /&gt;EncryptionAlgorithm = "None",&lt;BR /&gt;PrivacyLevel = "None"&lt;BR /&gt;}&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;// Update the datasource with the specified credentials&lt;BR /&gt;await client.Gateways.UpdateDatasourceAsync(datasources.Value[datasources.Value.Count - 1].GatewayId, datasources.Value[datasources.Value.Count - 1].Id, delta);&lt;/P&gt;</description>
      <pubDate>Fri, 17 Aug 2018 09:17:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Possible-to-update-credentials-via-REST-API/m-p/492473#M15085</guid>
      <dc:creator>Anuj_Shaubhari</dc:creator>
      <dc:date>2018-08-17T09:17:24Z</dc:date>
    </item>
    <item>
      <title>Re: Possible to update credentials via REST API?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Possible-to-update-credentials-via-REST-API/m-p/501670#M15420</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/2834"&gt;@TedPattison&lt;/a&gt;&amp;nbsp;- This was incredibly helpful, thank you for taking the time to document your experience. For the record, this worked for me in updating creds for a Redshift connection.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Aug 2018 22:59:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Possible-to-update-credentials-via-REST-API/m-p/501670#M15420</guid>
      <dc:creator>ddonahue</dc:creator>
      <dc:date>2018-08-28T22:59:48Z</dc:date>
    </item>
    <item>
      <title>Re: Possible to update credentials via REST API?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Possible-to-update-credentials-via-REST-API/m-p/871268#M21688</link>
      <description>&lt;P&gt;Ok, I'm trying to implement this in PowerShell, and hopefully for both Basic credentials and OAuth2.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm basing my code mostly from the documentation on this call here:&amp;nbsp;&lt;A href="https://docs.microsoft.com/en-us/rest/api/power-bi/gateways/updatedatasource" target="_blank" rel="noopener"&gt;https://docs.microsoft.com/en-us/rest/api/power-bi/gateways/updatedatasource&lt;/A&gt; and also on the C# &lt;A href="https://github.com/CriticalPathTraining/PbixInstallerForPowerBI/blob/master/PbixInstallerForPowerBI/Program.cs" target="_self"&gt;code here.&lt;/A&gt; by &lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/2834"&gt;@TedPattison&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm getting an error in both my attempts, first using OAuth2, and second using Basic.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My assumptions in this code:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;When using Basic authentication for a data source of type SQL, I assume that the username/password should be a valid SQL login name and password.&lt;/LI&gt;&lt;LI&gt;When using OAuth2 authentication, I assume I need one of the following set to true in the patch Json:&amp;nbsp;useCallerAADIdentity or&amp;nbsp;useEndUserOAuth2Credentials.&lt;OL&gt;&lt;LI&gt;I also assume that the value for AccessToken in the credentials attribute is the same access token that is used in the Authorization header (without the prefix "Bearer "), if I'm using&amp;nbsp;useCallerAADIdentity: true. This assumption seems to be a big one - the docs don't say anything about how to generate the access token for the PATCH.&amp;nbsp;&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;LI&gt;I assume you can use this PATCH call to change from Basic to OAuth2 authentication, and vice versa. Or that the existing data source doesn't have any valid authentication defined for it (such as the case when you have just published the PBIX file and you haven't gone to the dataset settings in the service).&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;The error I get for Basic authentication is this response:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Response: 400: Bad Request&lt;/P&gt;&lt;P&gt;Response Body:&lt;/P&gt;&lt;P&gt;41&lt;BR /&gt;{"error":{"code":"BadRequest","pbi.error":{"code":"BadRequest"}}}&lt;BR /&gt;0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The error I get for OAuth2 authentication is this response:&lt;/P&gt;&lt;P&gt;Response: 400: Bad Request&lt;/P&gt;&lt;P&gt;Response Body:&lt;/P&gt;&lt;P&gt;77&lt;BR /&gt;{"error":{"code":"InvalidRequest","message":"Specifying UseCallerOAuthIdentity requires credential type to be OAuth2"}}&lt;BR /&gt;0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;$powerbiUrl = "https://api.powerbi.com/v1.0"

Function Update-PowerBIGatewayDataSourceCredentials {
    Param(
        [parameter(Mandatory = $true)]$gatewayId,
        [parameter(Mandatory = $true)]$datasourceId,
        [parameter(Mandatory = $true)]$AccessToken,
        [parameter(Mandatory = $true)]$credentialType,
        [parameter(Mandatory = $false)]$userName,
        [parameter(Mandatory = $false)]$password
     )

    # PATCH https://api.powerbi.com/v1.0/myorg/gateways/{gatewayId}/datasources/{datasourceId}
    $url = $powerbiUrl + "/myorg/gateways/$gatewayId/datasources/$datasourceId"

    if ($credentialType -eq "OAuth2") {
$body = @"
{
    "credentialDetails": 
    {
        "credentialType": "OAuth2",
        "credentials": "{ \"credentialData\": [{\"name\":\"accessToken\", \"value\": \"$accessToken\"}]}",
        "useCallerAADIdentity" : true
    }
}
"@

}

if ($credentialType -eq "Basic") {

$body = @"
{
    "credentialDetails": 
    {
        "credentialType": "Basic",
        "credentials": "{ \"credentialData\": [{\"name\":\"username\", \"value\": \"$userName\"},{\"name\":\"password\", \"value\": \"$password\"}]}"
    }
}
"@

}


 $apiHeaders = @{
        'Content-Type'  = 'application/json'
        'Accept'  = 'application/json'
        'Authorization' = "Bearer $AccessToken"
    }

    $result = Invoke-RestMethod -Uri $Url -Headers $apiHeaders -Method "Patch" -Body $Body

}

# ********************************************************************************************
#
# Main entry point
#
# ********************************************************************************************

# existing Power BI report with a single connection for a SQL Azure database. 
# datasource is Import mode, not DirectQuery mode.

$workspaceName = "&amp;lt;a PowerBI workspace&amp;gt;"
$datasetName = "&amp;lt;a published dataset&amp;gt;"

#SQL login and password
$userName = "&amp;lt;sql login&amp;gt;"
$password = "&amp;lt;password for sql login&amp;gt;"


try {
    $token = Get-PowerBIAccessToken 
} 
catch [System.Exception] {
    Connect-PowerBIServiceAccount
    $token = Get-PowerBIAccessToken 
}

$accessToken = $token.Values -replace "Bearer ", ""

$ws = Get-PowerBIWorkspace | Where {$_.Name -eq $workspaceName }

$dataset = Get-PowerBIDataset -WorkspaceId $ws.Id | where {$_.Name -eq $datasetName }

$ds = Get-PowerBIDatasource -WorkspaceId $ws.Id -DatasetId $dataset.Id

$ds 

# set credentials using OAuth2 
Update-PowerBIGatewayDataSourceCredentials -gatewayId $ds.GatewayId -datasourceId $ds.DatasourceId -AccessToken $accessToken -credentialType "OAuth2" 

# set credentials using Basic (SQL login and password)

Update-PowerBIGatewayDataSourceCredentials -gatewayId $ds.GatewayId -datasourceId $ds.DatasourceId -AccessToken $accessToken -credentialType "Basic" -userName  $Username -password $password&lt;/LI-CODE&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;&lt;P&gt;Can anyone see what I'm doing wrong?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;</description>
      <pubDate>Tue, 10 Dec 2019 21:28:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Possible-to-update-credentials-via-REST-API/m-p/871268#M21688</guid>
      <dc:creator>xhead</dc:creator>
      <dc:date>2019-12-10T21:28:58Z</dc:date>
    </item>
    <item>
      <title>Re: Possible to update credentials via REST API?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Possible-to-update-credentials-via-REST-API/m-p/879190#M21770</link>
      <description>&lt;P&gt;I haven't heard from anyone on this. I'm going to also start a new thread to see if I can get some response.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2019 18:28:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Possible-to-update-credentials-via-REST-API/m-p/879190#M21770</guid>
      <dc:creator>xhead</dc:creator>
      <dc:date>2019-12-18T18:28:38Z</dc:date>
    </item>
    <item>
      <title>Re: Possible to update credentials via REST API?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Possible-to-update-credentials-via-REST-API/m-p/1700259#M28173</link>
      <description>&lt;P&gt;Has anyone managed to get the PATCH for datasource credentials for powerbi.com (NOT embedded) working yet? I'm trying to patch a datasource which connects to azure sql db directly. It'll take ownership and update the server ok, but it won't change the credentials or set the sso tickbox.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Mar 2021 08:25:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Possible-to-update-credentials-via-REST-API/m-p/1700259#M28173</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-03-03T08:25:55Z</dc:date>
    </item>
    <item>
      <title>Re: Possible to update credentials via REST API?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Possible-to-update-credentials-via-REST-API/m-p/1931070#M30248</link>
      <description>&lt;P&gt;this works actually, but do make sure the service principal is the owner of the dataset, otherwise you get a 401&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jun 2021 14:33:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Possible-to-update-credentials-via-REST-API/m-p/1931070#M30248</guid>
      <dc:creator>jessegorter</dc:creator>
      <dc:date>2021-06-30T14:33:03Z</dc:date>
    </item>
  </channel>
</rss>

