1

I am trying to update the credentials used by a PowerBI dataset when connecting to its data source using the Power BI API. However, what is achievable via the PowerBI service UI doesnt seem possible via the API.

I have a number of PowerBI reports with a number of discreet datasets that share a common datasource. I am trying to change the credentials used by a dataset when connecting to the data source without changing the credentials for ALL datasets.

For example I can change the credentials for a data set in the UI here:

enter image description here

In the API the only request I can find that allows me to update the datasource credentials is

pbiAdminClient.Gateways.UpdateDatasourceAsync

Which takes a request object of

UpdateDatasourceRequest

that allows you to specify the SQL username/password. However this changes the credentials for the entire datasource (and thus all datasets using it). I need to be able to specify the group, dataset, datasource and credentials but cant find an appropriate request in the API.

I have seen use of the REST endpoint direct

$"https://api.powerbi.com/v1.0/myorg/groups/{groupId}/datasets/{datasetKey}/updatedatasources"

but that doesnt allow credentials to be provided but DOES allow you to specify the group, dataset and some datasource details.

Is what I am trying to do even possible? The fact that I can do this via the UI makes me want to believe it is.

Thanks in advance for any help.

1 Answers1

0

If you use an On-Prem or VNet Gateway you can create multiple connections per Data Source, each with its own credentials.

For cloud data sources there's only connection per user, so to change the credentials for only one Dataset, take over the Dataset with a different user and have that user set the credentials.

David Browne - Microsoft
  • 80,331
  • 6
  • 39
  • 67