March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi All!
I have automated process that is uploading reports and datasource from pbix to PowerBI service. After datasource is there I'm trying to update credentials. I use UseCallerAADIdentity attribute during Update Datasource call (https://docs.microsoft.com/en-us/rest/api/power-bi/gateways/update-datasource). The api call returns error 500. With only one line in payload "Error occured".
I use following body:
I have found a similar question that is without answer:
Hey @oyermokhin,
Did you ever figure this one out?
Trying to do something similar for a cloud SQL DB, but keep getting either 500s (when I omit `credentials` altogether), or 400s (when I set `credentials` to null or an empty object).
The docs are pretty thin on the ground, so it's not entirely clear which sources this can be used on. It says "For Extension data sources, don't set useCallerAADIdentity to true". Then it says "To set OAuth 2.0 credentials for other data sources, send the OAuth 2.0 token in the payload as shown in the OAuth 2.0 credentials example."
So I can't use it for Extension data sources. And for other sources I need to specify the bearer token myself. I wonder - when can I actually use useCallerAADIdentity then? 😅
If you know any more on this and are happy to share, that would be great.
Thanks,
Ed
Hi @v-shex-msft
I'm sorry for late feedback this. Thanks you for your answer.
I previosly have tried to execute GetDatasources REST Api call to check the parameters, but the response does not help me. Here is a response
@odata.context : http://wabi-north-europe-redirect.analysis.windows.net/v1.0/myorg/groups/........../$metadata#datasources value : {@ {datasourceType=Extension; connectionDetails=; datasourceId=...............; gatewayId=.....} }
I also tried to get information about my datasource
with following endpoint
@odata.context : http://wabi-north-europe-redirect.analysis.windows.net/v1.0/myorg/$metadata#gatewayDatasources/$entity
id : ....
gatewayId : ....
datasourceType : Extension
connectionDetails : {"extensionDataSourceKind":"AzureDataExplorer","extensionDataSourcePath":"https://.....westeurope.kusto.windows.net"}
credentialType : OAuth2
credentialDetails : @{useEndUserOAuth2Credentials=False}
To give you more context I would say that I have used Kusto connector and the credentials object should be empty if theuseCallerAADIdentity is set to true. The idea is to use the AAD identity of the calling (app that will embed the report) application.
@oyermokhin : I am having a similar requirement where i need to update credentials for Azure Data Explorer data source through Power BI Rest API call in a powershell script. Were you successful in your approach ? If yes, do share the solution for this.
Hi @oyermokhin,
I think this error may mean you have used the invalid request contents of the API.
For this scenario, I'd like to suggest you use the get data source API to get the detail data source configurations then you can modify them with new credentials.
Datasets - Get Datasources - REST API (Power BI Power BI REST APIs) | Microsoft Docs
Regards,
Xiaoxin Sheng
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
8 | |
2 | |
1 | |
1 | |
1 |
User | Count |
---|---|
10 | |
3 | |
2 | |
2 | |
2 |