Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
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.

 

NOW!

 

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

 

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.

 

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???

0 REPLIES 0

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.