Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by watching the DP-600 session on-demand now through April 28th.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
Hi,
I've publish a report into a workspace that we use for development. To migrate the report from the Dev Worspace to an UAT one, I've build a PowerShell script that import the report. In the script, I'm changing the database connection of the dataset to point to the UAT server and database using the report parameters (not a gateway). The issue that I'm now facing is that I also need to change the data source credential of the dataset since the user that we use in UAT is not the same then Dev.
How can I change those information using the API or use User Id and User Password parameters ?
Solved! Go to Solution.
Hi,
I been able to change the data source credit using the UpdateDataSource API (https://docs.microsoft.com/en-us/rest/api/power-bi/gateways/updatedatasource).
The trick is to use the Get Datasource (https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/getdatasourcesingroup) before to retrieve the GatewayId and the DatasourceId link to the Dataset. Even if you didn't declare a Gateway to your Dataset (For direct link to SQL Server in Azure), there is one created in the background and link to a Datasource.
So, after calling the Get Datasource, I have all required information to call the UpdateDataSource and change the user Id and credential to connect to the new connection.
Issue solve.
Thanks
Have you tried this call?
https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/updatedatasources
Hi,
I been able to change the data source credit using the UpdateDataSource API (https://docs.microsoft.com/en-us/rest/api/power-bi/gateways/updatedatasource).
The trick is to use the Get Datasource (https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/getdatasourcesingroup) before to retrieve the GatewayId and the DatasourceId link to the Dataset. Even if you didn't declare a Gateway to your Dataset (For direct link to SQL Server in Azure), there is one created in the background and link to a Datasource.
So, after calling the Get Datasource, I have all required information to call the UpdateDataSource and change the user Id and credential to connect to the new connection.
Issue solve.
Thanks
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |