cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Rest API Update Datasource UseCallerAADIdentity or UseEndUserOAuth2Credentials not working

Hello,

 

We have the following issue, we want to update the data source credentials using the REST API. When updating the credentials we want to enable the checkbox "End users use their own OAuth2 credentials when accessing the data source via Direct Query".

 

OAuth2PowerBI.PNG

 

When making the REST call using the C# library or postman we receive the following error:

Specifying UseCallerOAuthIdentity requires credential type to be OAuth2

 

URL

https://api.powerbi.com/v1.0/myorg/gateways/{gatewayid}/datasources/{datasourceid}

Body

{
"credentialDetails":{
"credentialType":"OAuth2",
"credentials":"{\"credentialData\":[{\"name\":\"accessToken\",\"value\":\"eyJ0e...\" } ] }",
"encryptedConnection":"Encrypted",
"encryptionAlgorithm":"None",
"privacyLevel":"None",
"useCallerAADIdentity":true
}
}

 

When we don't try to check the checkbox the credentials are updating succesfully.

 

0 REPLIES 0

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

November Power BI Update 768x460.png

Check it Out!

Click here to read more about the November 2021 Updates!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.