Forum Discussion
API 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
Hi Anonymous ,
I think you can use PowerShell to change the data source connection string in a Power BI report, but only if the report uses parametric connections, otherwise the change is not supported.
Install the Reporting Services tool in powershell and change its parameters. Refer to the following official documentation for a detailed description of the steps.
Change data source connection strings in Power BI reports with PowerShell - Power BI Report Server
If the problem is still not resolved, please point it out and provide related operation screenshoots. Looking forward to your feedback.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 Replies
- AnonymousNot applicable
Hello
Thanks for the quit reply.
It works fine with ReportingServicesTools.
Set-RsRestItemDataModelParameters for Server and Database parameters
Set-RsRestItemDataSource for Login and Password
- v-henryk-mstfCommunity Support
Hi Anonymous ,
I think you can use PowerShell to change the data source connection string in a Power BI report, but only if the report uses parametric connections, otherwise the change is not supported.
Install the Reporting Services tool in powershell and change its parameters. Refer to the following official documentation for a detailed description of the steps.
Change data source connection strings in Power BI reports with PowerShell - Power BI Report Server
If the problem is still not resolved, please point it out and provide related operation screenshoots. Looking forward to your feedback.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.