<?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 PBIRS API issue in Report Server</title>
    <link>https://community.fabric.microsoft.com/t5/Report-Server/PBIRS-API-issue/m-p/1290394#M15524</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;following up on my &lt;A href="https://community.powerbi.com/t5/Report-Server/Power-bi-report-server-password-update/m-p/1287662#M15502" target="_self"&gt;previous question&lt;/A&gt; on how to batch update a password used in multiple reports. The&amp;nbsp;recommendation was to use the api.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I figured that I have to use this endpoint:&lt;/P&gt;&lt;P&gt;&lt;A href="https://app.swaggerhub.com/apis/microsoft-rs/PBIRS/2.0#/PowerBIReports/UpdatePowerBIReportDataSource" target="_blank"&gt;https://app.swaggerhub.com/apis/microsoft-rs/PBIRS/2.0#/PowerBIReports/UpdatePowerBIReportDataSource&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But when I send this request:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[
  {
    "DataModelDataSource": {
      "Username": "dummy user"
    }
  }
]&lt;/LI-CODE&gt;&lt;P&gt;the response is a 400 (bad request)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Authorization is no use since other request work fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any idea what I am doing wrong?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 12 Aug 2020 11:55:35 GMT</pubDate>
    <dc:creator>whereismydata</dc:creator>
    <dc:date>2020-08-12T11:55:35Z</dc:date>
    <item>
      <title>PBIRS API issue</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/PBIRS-API-issue/m-p/1290394#M15524</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;following up on my &lt;A href="https://community.powerbi.com/t5/Report-Server/Power-bi-report-server-password-update/m-p/1287662#M15502" target="_self"&gt;previous question&lt;/A&gt; on how to batch update a password used in multiple reports. The&amp;nbsp;recommendation was to use the api.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I figured that I have to use this endpoint:&lt;/P&gt;&lt;P&gt;&lt;A href="https://app.swaggerhub.com/apis/microsoft-rs/PBIRS/2.0#/PowerBIReports/UpdatePowerBIReportDataSource" target="_blank"&gt;https://app.swaggerhub.com/apis/microsoft-rs/PBIRS/2.0#/PowerBIReports/UpdatePowerBIReportDataSource&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But when I send this request:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[
  {
    "DataModelDataSource": {
      "Username": "dummy user"
    }
  }
]&lt;/LI-CODE&gt;&lt;P&gt;the response is a 400 (bad request)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Authorization is no use since other request work fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any idea what I am doing wrong?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Aug 2020 11:55:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/PBIRS-API-issue/m-p/1290394#M15524</guid>
      <dc:creator>whereismydata</dc:creator>
      <dc:date>2020-08-12T11:55:35Z</dc:date>
    </item>
    <item>
      <title>Re: PBIRS API issue</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/PBIRS-API-issue/m-p/1291870#M15534</link>
      <description>&lt;P&gt;So firstly make sure you are using the PATCH method for your request.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then there are a couple of things wrong with your payload. Firstly you can have multiple datasources in a report so I'm pretty sure you would need to include the id of the datasource in your payload. And it does not make sense to just change the username, you would most likely need to also include the secret.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would suggest that you first do a GET on this endpoint to get the array of existing datasources, then modify the username/secret and issue a PATCH request.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2020 01:16:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/PBIRS-API-issue/m-p/1291870#M15534</guid>
      <dc:creator>d_gosbell</dc:creator>
      <dc:date>2020-08-13T01:16:39Z</dc:date>
    </item>
    <item>
      <title>Re: PBIRS API issue</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/PBIRS-API-issue/m-p/1293210#M15543</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;based on your input I did some more research. The error was, as you expected, that the payload was wrong. I thougth because auf the patch method only several fields need to be put into the payload. But instead the whole body needs to be in the payload. Now it works fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;body of the get request:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{
  "@odata.context": "uri",
  "value": [
    {
      "Id": "datasourceId",
      "Name": null,
      "Description": null,
      "Path": null,
      "Type": "DataSource",
      "Hidden": false,
      "Size": 0,
      "ModifiedBy": "name",
      "ModifiedDate": "datetime",
      "CreatedBy": "name",
      "CreatedDate": "datetime",
      "ParentFolderId": null,
      "IsFavorite": false,
      "Roles": [],
      "ContentType": null,
      "Content": "",
      "IsEnabled": true,
      "ConnectionString": "domain",
      "DataSourceType": null,
      "IsOriginalConnectionStringExpressionBased": false,
      "IsConnectionStringOverridden": false,
      "CredentialRetrieval": "prompt",
      "CredentialsByUser": null,
      "CredentialsInServer": null,
      "IsReference": false,
      "DataSourceSubType": "DataModel",
      "DataModelDataSource": {
        "Type": "Import",
        "Kind": "ActiveDirectory",
        "AuthType": "Windows",
        "SupportedAuthTypes": [
          "Windows",
          "UsernamePassword"
        ],
        "Username": "OldUsername",
        "Secret": "", //Password is empty in get request
        "ModelConnectionName": ""
      }
    }
  ]
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this is the payload that worked for me (only use the value array):&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;[
  {
    "Id": "Datasource id",
    "Name": null,
    "Description": null,
    "Path": null,
    "Type": "DataSource",
    "Hidden": false,
    "Size": 0,
    "ModifiedBy": "name",
    "ModifiedDate": "datetime",
    "CreatedBy": "name",
    "CreatedDate": "datetime",
    "ParentFolderId": null,
    "IsFavorite": false,
    "Roles": [],
    "ContentType": null,
    "Content": "",
    "IsEnabled": true,
    "ConnectionString": "domain",
    "DataSourceType": null,
    "IsOriginalConnectionStringExpressionBased": false,
    "IsConnectionStringOverridden": false,
    "CredentialRetrieval": "prompt",
    "CredentialsByUser": null,
    "CredentialsInServer": null,
    "IsReference": false,
    "DataSourceSubType": "DataModel",
    "DataModelDataSource": {
      "Type": "Import",
      "Kind": "ActiveDirectory",
      "AuthType": "Windows",
      "SupportedAuthTypes": [
        "Windows",
        "UsernamePassword"
      ],
      "Username": "yourNewUsername",
      "Secret": "yourNewPassword",
      "ModelConnectionName": ""
    }
  }
]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;regarding the id: I read that when there is more than one source, every source needs to be in the requestbody, even if nothing changes&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;useful links:&lt;/P&gt;&lt;P&gt;&lt;A href="http://dataap.org/blog/2020/01/16/power-bi-report-server-change-data-source-using-rest-apis/" target="_self"&gt;http://dataap.org/blog/2020/01/16/power-bi-report-server-change-data-source-using-rest-apis/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://web.archive.org/web/20190215010547/https://parthpsha.com/programmatically-setting-and-verifying-data-source-credentials-for-power-bi-reports/" target="_self"&gt;https://web.archive.org/web/20190215010547/https://parthpsha.com/programmatically-setting-and-verifying-data-source-credentials-for-power-bi-reports/&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Report-Server/Power-Bi-report-deployment-to-Production/td-p/662197" target="_self"&gt;https://community.powerbi.com/t5/Report-Server/Power-Bi-report-deployment-to-Production/td-p/662197&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Microsoft/ReportingServicesTools/issues/116" target="_self"&gt;https://github.com/Microsoft/ReportingServicesTools/issues/116&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Report-Server/REST-API-on-PBIRS-on-prem-Oct-2017-Update-PowerBIReports/td-p/350863" target="_self"&gt;https://community.powerbi.com/t5/Report-Server/REST-API-on-PBIRS-on-prem-Oct-2017-Update-PowerBIReports/td-p/350863&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2020 10:50:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/PBIRS-API-issue/m-p/1293210#M15543</guid>
      <dc:creator>whereismydata</dc:creator>
      <dc:date>2020-08-13T10:50:44Z</dc:date>
    </item>
    <item>
      <title>Re: PBIRS API issue</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/PBIRS-API-issue/m-p/3790050#M33849</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;P&gt;this is the payload that worked for me &lt;STRONG&gt;(only use the value array)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;Thank you! I was trying to change a report's ConnectionString using the PATCH method and it was not working no matter what. Turns out I needed to use only the value array, and deleting the @odata.context thing before the value array made it work.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2024 20:28:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/PBIRS-API-issue/m-p/3790050#M33849</guid>
      <dc:creator>paulobecker</dc:creator>
      <dc:date>2024-03-25T20:28:26Z</dc:date>
    </item>
  </channel>
</rss>

