api v2 datasources patch
2 TopicsPBIRS 404 Bad Request when trying to change Connection String from PowerBIReports(id)/DataSources ap
Hi we recently started a server changeover for an SQL which was hosting the PowerBI Report Server. We have migrated the database and the encryption key and everything was a success. However now we wanted to change the connection string to point to the new server. The reports are connected using the SQL Server connection and they are all in import mode. Due to the fact that we had lots of reports we thought of automating this process through the use of the API. So what we did is we used the API endpoint identified in the subject and get the result, then we used the result in the value key and pasted it in the body and used the patch. However we are getting an HTTP 400 Bad Request message. Can you please advise the reason for this? Thanks680Views0likes1CommentAPI V2 : patch DataSources for change connection string, username and password
Hello, For a pbi with datasource mode Import, I'am able to change the Username and Password but not able to change ConnectionString. For my test I just retrive the datasource objet with GET PowerBIReports(uid)/DataSources I modify ConnectionString attribute, DataModelDataSource\Username and DataModelDataSource\Password Then I PATCH with GET PowerBIReports(uid)/DataSources and the modified body. If I only change DataModelDataSource\Username and DataModelDataSource\Password its OK (200) If I change ConnectionString its 400 Bad Request I have to change others attributes in my Body? Here the body: [ { "Id": "uid", "Name": null, "Description": null, "Path": null, "Type": "DataSource", "Hidden": false, "Size": 0, "ModifiedBy": "me", "ModifiedDate": "2022-01-21T12:07:41.557+01:00", "CreatedBy": "me", "CreatedDate": "2022-01-21T09:31:56.927+01:00", "ParentFolderId": null, "IsFavorite": false, "IsEnabled": true, "ConnectionString": "XXXservernameXXX;XXXdatabasenameXXX", "DataSourceType": "SQL", "IsConnectionStringOverridden": true, "IsReference": false, "DataSourceSubType": "DataModel", "CredentialsByUser": null, "CredentialsInServer": null, "DataModelDataSource": { "Type": "Import", "Kind": "SQL", "AuthType": "UsernamePassword", "SupportedAuthTypes": [ "Windows", "UsernamePassword" ], "Username": "xxx", "Secret": "xxx", "ModelConnectionName": "2790F0B88BC436CD2B78E4E6D532479CB2EA13D23BF04263D88ABB80DABCD863" } } ]Solved1.5KViews0likes2Comments