<?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: Rest API Update Datasource returns an error when using UseCallerAADIdentity in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Rest-API-Update-Datasource-returns-an-error-when-using/m-p/2541748#M36353</link>
    <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/315831"&gt;@oyermokhin&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did you ever figure this one out?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Trying to do something similar for a cloud SQL DB, but keep getting either 500s (when I omit `credentials` altogether), or 400s (when I set `credentials` to null or an empty object).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The docs are pretty thin on the ground, so it's not entirely clear which sources this can be used on. It says "&lt;SPAN&gt;For&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Extension&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;data sources, &lt;EM&gt;&lt;STRONG&gt;don't set&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp;&lt;/SPAN&gt;useCallerAADIdentity&lt;SPAN&gt;&amp;nbsp;to&amp;nbsp;&lt;/SPAN&gt;true". Then it says "&lt;SPAN&gt;To set OAuth 2.0 credentials for &lt;EM&gt;&lt;STRONG&gt;other data sources&lt;/STRONG&gt;&lt;/EM&gt;, send the OAuth 2.0 token in the payload as shown in the&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://docs.microsoft.com/en-us/rest/api/power-bi/gateways/update-datasource#oauth2-credentials-example" target="_blank" rel="noopener"&gt;OAuth 2.0 credentials example&lt;/A&gt;&lt;SPAN&gt;."&lt;/SPAN&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I can't use it for Extension data sources. And for other sources I need to specify the bearer token myself. I wonder - when can I actually use&amp;nbsp;useCallerAADIdentity&lt;SPAN&gt;&amp;nbsp; then?&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face_with_sweat:"&gt;😅&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you know any more on this and are happy to share, that would be great.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ed&lt;/P&gt;</description>
    <pubDate>Thu, 26 May 2022 15:13:22 GMT</pubDate>
    <dc:creator>ed-freeman</dc:creator>
    <dc:date>2022-05-26T15:13:22Z</dc:date>
    <item>
      <title>Rest API Update Datasource returns an error when using UseCallerAADIdentity</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Rest-API-Update-Datasource-returns-an-error-when-using/m-p/2072868#M31725</link>
      <description>&lt;P&gt;Hi All!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have automated process that is uploading reports and datasource from pbix to PowerBI service. After datasource is there I'm trying to update credentials. I use&amp;nbsp;UseCallerAADIdentity attribute during Update Datasource call (&lt;A href="https://docs.microsoft.com/en-us/rest/api/power-bi/gateways/update-datasource" target="_blank" rel="noopener"&gt;https://docs.microsoft.com/en-us/rest/api/power-bi/gateways/update-datasource&lt;/A&gt;). The api call returns error 500. With only one line in payload "Error occured".&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use following body:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"credentialDetails"&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;@&lt;/SPAN&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"credentialType"&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;"OAuth2"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"useCallerAADIdentity"&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;"True"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"encryptedConnection"&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;"Encrypted"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"encryptionAlgorithm"&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;"None"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"privacyLevel"&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;"Private"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Does anybody know what is wrong here?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I can also see that the parameter seems to be correct accoring these tests -&amp;nbsp;&lt;A href="https://github.com/microsoft/PowerBI-CSharp/blob/master/sdk/PowerBI.Api.Tests/CredentialsTests.cs" target="_blank" rel="noopener"&gt;https://github.com/microsoft/PowerBI-CSharp/blob/master/sdk/PowerBI.Api.Tests/CredentialsTests.cs&lt;/A&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Line 71.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have found a similar question that is without answer:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Developer/Rest-API-Update-Datasource-UseCallerAADIdentity-or/td-p/762726" target="_blank" rel="noopener"&gt;https://community.powerbi.com/t5/Developer/Rest-API-Update-Datasource-UseCallerAADIdentity-or/td-p/762726&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Sep 2021 13:04:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Rest-API-Update-Datasource-returns-an-error-when-using/m-p/2072868#M31725</guid>
      <dc:creator>oyermokhin</dc:creator>
      <dc:date>2021-09-13T13:04:32Z</dc:date>
    </item>
    <item>
      <title>Re: Rest API Update Datasource returns an error when using UseCallerAADIdentity</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Rest-API-Update-Datasource-returns-an-error-when-using/m-p/2078835#M31789</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/315831"&gt;@oyermokhin&lt;/a&gt;,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;I think this error may mean you have used the invalid request contents of the API.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;For this scenario, I'd like to suggest you use the get data source API to get the detail data source configurations then you can modify them with new credentials.&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/get-datasources" target="_blank"&gt;Datasets - Get Datasources - REST API (Power BI Power BI REST APIs) | Microsoft Docs&lt;/A&gt;&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, 16 Sep 2021 01:37:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Rest-API-Update-Datasource-returns-an-error-when-using/m-p/2078835#M31789</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-09-16T01:37:49Z</dc:date>
    </item>
    <item>
      <title>Re: Rest API Update Datasource returns an error when using UseCallerAADIdentity</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Rest-API-Update-Datasource-returns-an-error-when-using/m-p/2092172#M31968</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&amp;nbsp;@Anonymous&lt;/a&gt;&lt;/P&gt;&lt;P&gt;I'm sorry for late feedback this. Thanks you for your answer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I previosly have tried to execute GetDatasources REST Api call to check the parameters, but the response does not help me. Here is a response&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;LI-CODE lang="javascript"&gt; @odata.context : http://wabi-north-europe-redirect.analysis.windows.net/v1.0/myorg/groups/........../$metadata#datasources value : {@ {datasourceType=Extension; connectionDetails=; datasourceId=...............; gatewayId=.....} } &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also tried to get information about my datasource&lt;/P&gt;&lt;P&gt;with following endpoint&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;GET https://&lt;SPAN&gt;api.powerbi.com&lt;SPAN&gt;/v1.&lt;SPAN&gt;0&lt;SPAN&gt;/myorg/gateways/{gatewayId}/datasources/{datasourceId}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;This return following:&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;@odata.context    : http://wabi-north-europe-redirect.analysis.windows.net/v1.0/myorg/$metadata#gatewayDatasources/$entity
id                : ....
gatewayId         : ....
datasourceType    : Extension
connectionDetails : {"extensionDataSourceKind":"AzureDataExplorer","extensionDataSourcePath":"https://.....westeurope.kusto.windows.net"}
credentialType    : OAuth2
credentialDetails : @{useEndUserOAuth2Credentials=False} &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;To give you more context I would say that I have used Kusto connector and the credentials object should be empty if the&lt;SPAN&gt;useCallerAADIdentity is set to true. The idea is to use the AAD identity of the calling (app that will embed the report) application.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Sep 2021 17:52:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Rest-API-Update-Datasource-returns-an-error-when-using/m-p/2092172#M31968</guid>
      <dc:creator>oyermokhin</dc:creator>
      <dc:date>2021-09-22T17:52:22Z</dc:date>
    </item>
    <item>
      <title>Re: Rest API Update Datasource returns an error when using UseCallerAADIdentity</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Rest-API-Update-Datasource-returns-an-error-when-using/m-p/2541748#M36353</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/315831"&gt;@oyermokhin&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did you ever figure this one out?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Trying to do something similar for a cloud SQL DB, but keep getting either 500s (when I omit `credentials` altogether), or 400s (when I set `credentials` to null or an empty object).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The docs are pretty thin on the ground, so it's not entirely clear which sources this can be used on. It says "&lt;SPAN&gt;For&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Extension&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;data sources, &lt;EM&gt;&lt;STRONG&gt;don't set&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp;&lt;/SPAN&gt;useCallerAADIdentity&lt;SPAN&gt;&amp;nbsp;to&amp;nbsp;&lt;/SPAN&gt;true". Then it says "&lt;SPAN&gt;To set OAuth 2.0 credentials for &lt;EM&gt;&lt;STRONG&gt;other data sources&lt;/STRONG&gt;&lt;/EM&gt;, send the OAuth 2.0 token in the payload as shown in the&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://docs.microsoft.com/en-us/rest/api/power-bi/gateways/update-datasource#oauth2-credentials-example" target="_blank" rel="noopener"&gt;OAuth 2.0 credentials example&lt;/A&gt;&lt;SPAN&gt;."&lt;/SPAN&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I can't use it for Extension data sources. And for other sources I need to specify the bearer token myself. I wonder - when can I actually use&amp;nbsp;useCallerAADIdentity&lt;SPAN&gt;&amp;nbsp; then?&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face_with_sweat:"&gt;😅&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you know any more on this and are happy to share, that would be great.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ed&lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2022 15:13:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Rest-API-Update-Datasource-returns-an-error-when-using/m-p/2541748#M36353</guid>
      <dc:creator>ed-freeman</dc:creator>
      <dc:date>2022-05-26T15:13:22Z</dc:date>
    </item>
    <item>
      <title>Re: Rest API Update Datasource returns an error when using UseCallerAADIdentity</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Rest-API-Update-Datasource-returns-an-error-when-using/m-p/3054446#M40996</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/315831"&gt;@oyermokhin&lt;/a&gt;&amp;nbsp;: I am having a similar requirement where i need to update credentials for Azure Data Explorer data source through Power BI Rest API call in a powershell script. Were you successful in your approach ? If yes, do share the solution for this.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Feb 2023 06:56:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Rest-API-Update-Datasource-returns-an-error-when-using/m-p/3054446#M40996</guid>
      <dc:creator>Eshan1987</dc:creator>
      <dc:date>2023-02-01T06:56:18Z</dc:date>
    </item>
  </channel>
</rss>

