Forum Discussion
Power BI REST API Update datasource credentials
- Anonymous6 years ago
HI ivanferr92,
I also check the rest API documents but not found any apis to direct operate the data source credentials. (some of API can update the connection strings but they not mention/contains any parameters to operate on data credentials)
I guess power bi service may not want to share them due to security reasons.Regards,
Xiaoxin Sheng
above code throw "Operation returned an invalid status code 'Unauthorized' on "client.Gateways.UpdateDatasource" event thou I have given all powerBI API permission include Tenant.ReadWrite. I don't use the gateway, Is this the reason for the error?
There is still a gateway ID and you need to use the Gateway API even when there is no actual Gateway.
Are you using service principal? If so, did you go through all the proper configuration to enable service principal access to Power BI API in your tenant and add servide principal as gatewway admin?
- Anonymous5 years agoNot applicable
It's still not clear to me how this works as for Azure datasources, the docs say that the credentials are "per user" and so even if setting the credentals by an SP, wouldn't each user then have to enter the credentials themselves anyway?
- xli629b4 years agoHelper II
When there is no actual gateway, and it's a cloud datasource, I'm able to find a gateway ID as you say, interestingly enough.
However, when I try to update the datasource using this gateway ID + datasource ID, I always get an error: 400 DM_GWPipeline_Gateway_DataSourceAccessError. I also can't lookup this gateway using the get gateway method and retrieve its public key, which I need in order to encrypt the credentials.- nishanttayal3 years agoFrequent Visitor
Hi, Are you able to find the solution of this problem?