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
malagari
Responsive Resident
Responsive Resident

Possible to update credentials via REST API?

Does the current REST API support updating the data source credentials? I see that I'm able to update the connection string, but what about credentials? The only documentation I'm seeing is for credentials in a Data Gateway.

 

My main goal is to obfuscate the data source credentials from the end-user, and to deploy the .PBIX and all necessary connection information from the API.

 

Edit: To add clarification, I am talking about the PowerBI.com REST API, not the Embedded API.

Dan Malagari
Consultant at Headspring
1 ACCEPTED SOLUTION


@v-lvzhan-msft wrote:

@malagari

I've voted for your idea

 

Before I acutally did some research and thought I was close as I find this api Set Credentials. The datasource_id and gateway_id can be found via calling Get BoundGatewayDatasources. However when calling the Set Credential API, I've stuck by a  "DMTS_InvalidEncryptionAlgorithmError" error. I'm going to escalate this internally and will post back if there comes any update.

 

By the way, I don't find any API to create a data source for a dataset in a gateway, even though above two APIs work, We still need such an API otherwise we may have to configure the datasource manually.

 

 

 


@malagari@TedPattison

Here's the update from the Product team. The SET Credential API is for cloud datasources.

 

Based on my test, I can set credential with the API when the dataset is connecting to a Azure SQL database. 

 

to get the Datasource and gateway id the user should use this API:

GET https://api.powerbi.com/v1.0/myorg/datasets/{dataset_id}/Default.GetBoundGatewayDataSources

 

and then to use the set credentials API.

PATCH https://api.powerbi.com/v1.0/myorg/gateways/{gateway_id}/datasources/{datasource_id}

 

I thought the gateway_id in the PATCH API was an real gateway. While I got the declarification that It's not a real GW in this case, but this is what the API refers to.

 

@malagari

So if you're using SQL Azure database, then I think you can obfuscate the data source credentials from the end-user.

 

 

View solution in original post

21 REPLIES 21

Hey @Eric_Zhang,

 

Thanks for following up and voting for my idea. I really think this is crucial for the programmability of Power BI (and being able to control it completely through the API).  The Gateway API is close, but only works when using the On-premises Data Gateway.  I'm looking to be able to update the credentials / connection string of any data source.

 

I guess I'll have to keep an eye out for future updates.

 

 

Dan Malagari
Consultant at Headspring

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.

Top Kudoed Authors