cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
MrDomCodingGuy New Member
New Member

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

Helpful resources

Announcements
Exclusive LIVE Community Event #3 – Ask Arun Anything

Exclusive LIVE Community Event #3 – Ask Arun Anything

Join us in the third Triple A event!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

January 2020 Community Highlights

January 2020 Community Highlights

Make sure you didn't miss any of the things that happened in the community in January!

Difinity Conference

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors