Showing results for 
Search instead for 
Did you mean: 
Not applicable

Using Rest API to change a Report/Dataset to use a different On-Prem Enterprise Gateway

I have a developed a PowerBI report in Powerbi desktop, which is sourcing it's data from an on-prem Analysis Server.


In the  PowerBi service I have created a workspace, I have then installed a on-prem ( enterprise ) gateway, with a datasource which points to the same Analysis server,

when I publish my report from powerbi desktop it publishes into the workspace and automatically it is wired up to the gateway and all works good and well.




Using the PowerBI Restful API what I would like to do is take that same report  (pbix file ) and push it into a different workspace for which has a different on-prem gateway and datasource which points to our production Analysis Server, however I don't seem to be able to do this.


I have tired the following:



Uploading the Pbix to the production workspace using the powerbi powershell commandlet: New-PowerBIReport


This goes fine of course it's not wired up to anything which is expected.


I then trying to switch the gateway on the dataset for the report using this rest API call


Specifying the GatewayID I want it to bind to and the Datasource Id of the production analysis server.


Which then comes back with a error saying: DMTS_CanNotFindMatchingDatasourceInGatewayError


Which kind of makes sense because the report will be looking at the dev analysis server and that won't be configured on the prod gateway.


So I thought I wonder if I could change that on the report  using the API, and I can by using:


So using this I'm able to change the database name and server from development to Production, and verify the service has picked up this change.


Then I thought I could then call the bindtogatewayingroup and specify my production gateway and production datasource but it still fails with the same message.


After hours of research I'm coming to the conclusion that it's not possible to change a report from one gateway to another, unless the exact same data source exists on both gateways, which seems a bit pointless.


Is this a limitation of the API or am I doing something wrong???


Helpful resources



We are excited to announce the Power BI Super Users!

Wave Release 2

Check out the updates in Power BI.

Overview of Power BI 2020 release wave 2!

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!


The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors