<?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: Changing datasource credentials (OAuth2) for Paginated reports through REST API in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Changing-datasource-credentials-OAuth2-for-Paginated-reports/m-p/3384816#M43945</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN&gt;Xiaoxin Sheng,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Looking at the &lt;A href="https://learn.microsoft.com/en-us/rest/api/power-bi/reports/update-datasources-in-group" target="_self"&gt;API&lt;/A&gt;, you mentioned, it seems there is no options to provide credentials section.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;It is accepting only "updateDetails" in the &lt;A href="https://learn.microsoft.com/en-us/rest/api/power-bi/reports/update-datasources-in-group#request-body" target="_self"&gt;requestbody&lt;/A&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;And within "updateDetails" only connectionDetails and datasourceName can be provided (&lt;A href="https://learn.microsoft.com/en-us/rest/api/power-bi/reports/update-datasources-in-group#updaterdldatasourcedetails" target="_self"&gt;here&lt;/A&gt;).&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;When I tried to push credentials section - it replies back with 500 (Internal server error).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Do you any working example of the post body in this case?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Regarding datasource type - no, I am not changing the datasource type, it stay intact, only trying to update credentials.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Another thing I noticed, on the Gateway API - there are some notes regarding Paginated reports (for example, &lt;A href="https://learn.microsoft.com/en-us/rest/api/power-bi/gateways/update-datasource#permissions" target="_self"&gt;Permissions&lt;/A&gt; section), I am a bit confused now, if it is applicable to rdl reports or not.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Kind regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Zencheg&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 17 Aug 2023 08:58:20 GMT</pubDate>
    <dc:creator>Zencheg</dc:creator>
    <dc:date>2023-08-17T08:58:20Z</dc:date>
    <item>
      <title>Changing datasource credentials (OAuth2) for Paginated reports through REST API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Changing-datasource-credentials-OAuth2-for-Paginated-reports/m-p/3378574#M43872</link>
      <description>&lt;P&gt;Hi Folks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to set OAuth2 credentials for the Paginated reports (RDL) via PowerShell using service account (not SPN) with username/password, but getting 401 response from API:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
  "code": "PowerBINotAuthorizedException",
  "pbi.error": {
    "code": "PowerBINotAuthorizedException",
    "parameters": {},
    "details": [],
    "exceptionCulprit": 1
  }
}
Response status code does not indicate success: 401 (Unauthorized).&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The API I am using is the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;gateways/$gatewayId/datasources/$datasourceId&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/rest/api/power-bi/gateways/update-datasource#oauth-2.0-credentials-example" target="_self"&gt;Source.&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Datasources are Azure SQLs and I am not using gateways at all to access the data, but as I understood, I still need to use some gateways in the query: example&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The same REST API I can call successfully using the same account, when I am changing credentials for Datasources on any of the Datasets and it works.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Patch body is the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;        "credentialDetails" = @{
            "credentials"          = "{""credentialData"":[{""name"":""accessToken"",""value"":""$Token""}]}"
            "credentialType"       = "OAuth2"
            "encryptedConnection"  = "NotEncrypted"
            "encryptionAlgorithm"  = "None"
            "privacyLevel"         = "Organizational"
        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The scopes are the following for the account:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Scopes
https://analysis.windows.net/powerbi/api/App.Read.All https://analysis.windows.net/powerbi/api/Capacity.Read.All
https://analysis.windows.net/powerbi/api/Capacity.ReadWrite.All https://analysis.windows.net/powerbi/api/Content.Create
https://analysis.windows.net/powerbi/api/Dashboard.Read.All https://analysis.windows.net/powerbi/api/Dashboard.ReadWrite.All
https://analysis.windows.net/powerbi/api/Dataflow.Read.All https://analysis.windows.net/powerbi/api/Dataflow.ReadWrite.All
https://analysis.windows.net/powerbi/api/Dataset.Read.All https://analysis.windows.net/powerbi/api/Dataset.ReadWrite.All
https://analysis.windows.net/powerbi/api/Gateway.Read.All https://analysis.windows.net/powerbi/api/Gateway.ReadWrite.All
https://analysis.windows.net/powerbi/api/Pipeline.Deploy https://analysis.windows.net/powerbi/api/Pipeline.Read.All
https://analysis.windows.net/powerbi/api/Pipeline.ReadWrite.All https://analysis.windows.net/powerbi/api/Report.Read.All
https://analysis.windows.net/powerbi/api/Report.ReadWrite.All https://analysis.windows.net/powerbi/api/StorageAccount.Read.All
https://analysis.windows.net/powerbi/api/StorageAccount.ReadWrite.All https://analysis.windows.net/powerbi/api/Tenant.Read.All
https://analysis.windows.net/powerbi/api/Tenant.ReadWrite.All https://analysis.windows.net/powerbi/api/UserState.ReadWrite.All
https://analysis.windows.net/powerbi/api/Workspace.Read.All https://analysis.windows.net/powerbi/api/Workspace.ReadWrite.All
https://analysis.windows.net/powerbi/api/.default &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Am I using the wrong URL to patch paginated reports or this is related to permission issue?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;</description>
      <pubDate>Mon, 14 Aug 2023 08:30:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Changing-datasource-credentials-OAuth2-for-Paginated-reports/m-p/3378574#M43872</guid>
      <dc:creator>Zencheg</dc:creator>
      <dc:date>2023-08-14T08:30:32Z</dc:date>
    </item>
    <item>
      <title>Re: Changing datasource credentials (OAuth2) for Paginated reports through REST API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Changing-datasource-credentials-OAuth2-for-Paginated-reports/m-p/3384114#M43932</link>
      <description>&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="602573" data-lia-user-login="Zencheg" class="lia-mention lia-mention-user"&gt;Zencheg&lt;/a&gt;,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;I'm not so sure if the gateway API fully compatibility with paginated reports. &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;In my opinion, I'd like to suggest change to use 'Reports - Update Data sources In Group' API to do update data source operations, this API is worked for update specific paginated report data source:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;&lt;A href="https://learn.microsoft.com/en-us/rest/api/power-bi/reports/update-datasources-in-group" target="_blank"&gt;Reports - Update Datasources In Group - REST API (Power BI Power BI REST APIs) | Microsoft Learn&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;BTW, did you change the data source type in these operations? Current power bi rest api not support ot directly change data source types in the update datasource operations.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;&lt;EM&gt;Limitations&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;&lt;EM&gt;1. Only supports paginated reports.&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;&lt;EM&gt;2. Changing the data source type isn't supported.&lt;/EM&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, 17 Aug 2023 01:58:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Changing-datasource-credentials-OAuth2-for-Paginated-reports/m-p/3384114#M43932</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-08-17T01:58:29Z</dc:date>
    </item>
    <item>
      <title>Re: Changing datasource credentials (OAuth2) for Paginated reports through REST API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Changing-datasource-credentials-OAuth2-for-Paginated-reports/m-p/3384816#M43945</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN&gt;Xiaoxin Sheng,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Looking at the &lt;A href="https://learn.microsoft.com/en-us/rest/api/power-bi/reports/update-datasources-in-group" target="_self"&gt;API&lt;/A&gt;, you mentioned, it seems there is no options to provide credentials section.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;It is accepting only "updateDetails" in the &lt;A href="https://learn.microsoft.com/en-us/rest/api/power-bi/reports/update-datasources-in-group#request-body" target="_self"&gt;requestbody&lt;/A&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;And within "updateDetails" only connectionDetails and datasourceName can be provided (&lt;A href="https://learn.microsoft.com/en-us/rest/api/power-bi/reports/update-datasources-in-group#updaterdldatasourcedetails" target="_self"&gt;here&lt;/A&gt;).&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;When I tried to push credentials section - it replies back with 500 (Internal server error).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Do you any working example of the post body in this case?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Regarding datasource type - no, I am not changing the datasource type, it stay intact, only trying to update credentials.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Another thing I noticed, on the Gateway API - there are some notes regarding Paginated reports (for example, &lt;A href="https://learn.microsoft.com/en-us/rest/api/power-bi/gateways/update-datasource#permissions" target="_self"&gt;Permissions&lt;/A&gt; section), I am a bit confused now, if it is applicable to rdl reports or not.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Kind regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Zencheg&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Aug 2023 08:58:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Changing-datasource-credentials-OAuth2-for-Paginated-reports/m-p/3384816#M43945</guid>
      <dc:creator>Zencheg</dc:creator>
      <dc:date>2023-08-17T08:58:20Z</dc:date>
    </item>
    <item>
      <title>Re: Changing datasource credentials (OAuth2) for Paginated reports through REST API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Changing-datasource-credentials-OAuth2-for-Paginated-reports/m-p/3389660#M44000</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="602573" data-lia-user-login="Zencheg" class="lia-mention lia-mention-user"&gt;Zencheg&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Perhpaps you can try to add the authentications in 'updateDetails'&amp;nbsp;similar as following code:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;    "updateDetails": [
        {
            "datasourceName": "{datasource_name}",
            "connectionDetails": {
                "server": "{server_name}",
                "database": "{database_name}",
                "authentication": {
                    "type": "OAuth2",
                    "token": "{oauth2_token}"
                }
            }
        }
    ]&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;gt;&amp;gt;&lt;SPAN&gt;Datasources are Azure SQLs and I am not using gateways at all to access the data, but as I understood, I still need to use some gateways in the query&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;That API only work for the datasource which bind to the gateway. When you are handle with one query mixed multiple type of data sources, you can turn on the option to also use gateway to manage data source which not required gateway. (e.g. a dataset include both on premise and cloud data sources)&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/power-bi/connect-data/service-gateway-mashup-on-premises-cloud" target="_blank"&gt;Merge or append on-premises and cloud data sources - Power BI | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Xiaoxin Sheng&lt;/P&gt;</description>
      <pubDate>Mon, 21 Aug 2023 08:59:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Changing-datasource-credentials-OAuth2-for-Paginated-reports/m-p/3389660#M44000</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-08-21T08:59:45Z</dc:date>
    </item>
    <item>
      <title>Re: Changing datasource credentials (OAuth2) for Paginated reports through REST API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Changing-datasource-credentials-OAuth2-for-Paginated-reports/m-p/3396308#M44054</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;SPAN&gt;Xiaoxin Sheng!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you for your help. The way you mentioned it is able to set the credentials properly.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Kind regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Zencheg&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2023 06:45:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Changing-datasource-credentials-OAuth2-for-Paginated-reports/m-p/3396308#M44054</guid>
      <dc:creator>Zencheg</dc:creator>
      <dc:date>2023-08-24T06:45:34Z</dc:date>
    </item>
  </channel>
</rss>

