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,then I publish my report from powerbi desktop which it then publishes into the workspace and automatically it is wired up to the gateway and all works good and well.
I want to take this pbix file and upload to a the production workspace which has a different gateway and a datasource which points to our production analysis server.
So I'm doing 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
https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/bindtogatewayingroup
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: https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/updatedatasourcesingroup
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 "DMTS_CanNotFindMatchingDatasourceInGatewayError"
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???