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

Change a datasource in a dataset that's connected through a gateway using Service Principal

I want to be able to change a datasource in a dataset that's connected through a gateway using Service Principal (SP) and the .NET client library available as nuget. This to be able to change the datasource of a report connected to a dataset (the dataset which is contained with a gateway) from eg. Dev to Test and eventually to use Production data.

The specific function I planned to use was https://docs.microsoft.com/en-us/dotnet/api/microsoft.powerbi.api.v2.datasets.updatedatasourcesingro... (which implements https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/updatedatasourcesingroup). 

However I run into a problem. The SP user I authenticate with to call the .NET client is not an admin in the gateway and not authorized. 

 

I therefore tried to add the SP as an admin to the gateway usnig https://docs.microsoft.com/en-us/rest/api/power-bi/gateways/adddatasourceuser#example-for-giving-rea... with my user (who is an admin) but this didn't work either, i get DMTS_DatasourceAccessRightIsNotSupportedError.

I googled on DMTS_DatasourceAccessRightIsNotSupportedError and got one hit: https://community.powerbi.com/t5/Developer/DMTS-DatasourceAccessRightIsNotSupportedError-when-trying... which I asked this same question a few days ago but I realized that if I created a seperat thread with a more descriptive title I hopefully could get help faster , and also help others with similar issues when trying to add a Service Principal as Admin to a Gateway.

 

I found this on Github which suggests that this should be possible: https://github.com/MicrosoftDocs/powerbi-docs/issues/1067

 

1 REPLY 1
eduardocorpus
Frequent Visitor

Hi, did you figure out how to do it?

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.