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 Zencheg,
I'm not so sure if the gateway API fully compatibility with paginated reports.
In my opinion, I'd like to suggest change to use 'Reports - Update Data sources In Group' API to do update data source operations, this API is worked for update specific paginated report data source:
Reports - Update Datasources In Group - REST API (Power BI Power BI REST APIs) | Microsoft Learn
BTW, did you change the data source type in these operations? Current power bi rest api not support ot directly change data source types in the update datasource operations.
Limitations
1. Only supports paginated reports.
2. Changing the data source type isn't supported.
Regards,
Xiaoxin Sheng