Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi all,
Currently, I'm looking for a solution how to update datasource crenditials with 'Azure Active Directory - Password' via PowerBI REST API. Great help comes already from the documentation page: https://docs.microsoft.com/en-us/rest/api/power-bi/gateways/updatedatasource.
I've managed to update datasource credentials with credentialType 'Basic' with the following working code:
string username = "UserName"
string password = "Secret101"
string credentials = $"{{\"credentialData\":[{{\"name\":\"username\", \"value\":{JsonConvert.SerializeObject(username)}}},{{\"name\":\"password\", \"value\":{JsonConvert.SerializeObject(password)}}}]}}";
CredentialDetails credentialDetails = new CredentialDetails(credentialType: "Basic", credentials: credentials, encryptedConnection: "Encrypted", encryptionAlgorithm: "None", privacyLevel: "None");
UpdateDatasourceRequest updateDatasourceRequest = new UpdateDatasourceRequest(credentialDetails);
client.Gateways.UpdateDatasource(gatewayDatasource.GatewayId, gatewayDatasource.Id, updateDatasourceRequest);
But now I want to use 'Azure Active Directory - Password' as authentication as in SSMS (see screenshot below). What credentialType do I have to use for example?
Thanks in advance!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 1 |
| User | Count |
|---|---|
| 4 | |
| 4 | |
| 4 | |
| 3 | |
| 3 |