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:
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.