Forum Discussion
Anonymous
7 years agoNot applicable
Powershell script to change Datasource Test to Production
Does someone have a powershell script to change the data source? For example I want deploy my report to powerBI reporting service from Test to Productios therefore i need to change the datasou...
mgmeyer
7 years agoPower BI Team
I don't know if there is an existing script for this however it should be pretty straightforward assuming your using Shared DataSources. All you would need to do is issue a PUT request to the following REST API for each of your reports:
http://<server>/reports/api/v2.0/Reports(ID/Path)/DataSources
As for the payload you just need to update the path to the new DataSource. You can refer to the API docs here:
https://app.swaggerhub.com/apis/microsoft-rs/PBIRS/2.0#/Reports/SetReportDataSource