Forum Discussion
Changing datasource credentials (OAuth2) for Paginated reports through REST API
- Anonymous3 years ago
Hi Zencheg,
Perhpaps you can try to add the authentications in 'updateDetails' similar as following code:
"updateDetails": [ { "datasourceName": "{datasource_name}", "connectionDetails": { "server": "{server_name}", "database": "{database_name}", "authentication": { "type": "OAuth2", "token": "{oauth2_token}" } } } ]>>Datasources are Azure SQLs and I am not using gateways at all to access the data, but as I understood, I still need to use some gateways in the query
That API only work for the datasource which bind to the gateway. When you are handle with one query mixed multiple type of data sources, you can turn on the option to also use gateway to manage data source which not required gateway. (e.g. a dataset include both on premise and cloud data sources)
Merge or append on-premises and cloud data sources - Power BI | Microsoft Learn
Regards,
Xiaoxin Sheng
Hi Xiaoxin Sheng,
Looking at the API, you mentioned, it seems there is no options to provide credentials section.
It is accepting only "updateDetails" in the requestbody.
And within "updateDetails" only connectionDetails and datasourceName can be provided (here).
When I tried to push credentials section - it replies back with 500 (Internal server error).
Do you any working example of the post body in this case?
Regarding datasource type - no, I am not changing the datasource type, it stay intact, only trying to update credentials.
Another thing I noticed, on the Gateway API - there are some notes regarding Paginated reports (for example, Permissions section), I am a bit confused now, if it is applicable to rdl reports or not.
Kind regards,
Zencheg
Hi Zencheg,
Perhpaps you can try to add the authentications in 'updateDetails' similar as following code:
"updateDetails": [
{
"datasourceName": "{datasource_name}",
"connectionDetails": {
"server": "{server_name}",
"database": "{database_name}",
"authentication": {
"type": "OAuth2",
"token": "{oauth2_token}"
}
}
}
]
>>Datasources are Azure SQLs and I am not using gateways at all to access the data, but as I understood, I still need to use some gateways in the query
That API only work for the datasource which bind to the gateway. When you are handle with one query mixed multiple type of data sources, you can turn on the option to also use gateway to manage data source which not required gateway. (e.g. a dataset include both on premise and cloud data sources)
Merge or append on-premises and cloud data sources - Power BI | Microsoft Learn
Regards,
Xiaoxin Sheng
- Zencheg2 years agoRegular Visitor
Hi, Xiaoxin Sheng!
Thank you for your help. The way you mentioned it is able to set the credentials properly.
Kind regards,
Zencheg