I created a REST API that is responsible for updating the data source of the specific report and then refreshing it.
API to update the datasource: https://api.powerbi.com/v1.0/myorg/datasets/{datasetId}/Default.UpdateDatasources
API to refresh the dataset:
https://api.powerbi.com/v1.0/myorg/datasets/{datasetId}/refreshes
When I try to refresh the dataset, I get some credentials related error:
The refresh failed for this model. Expand the technical details for more info.Hide details
Data source error: It looks like scheduled refresh failed because at least one data source is missing credentials. To start the refresh again, go to this dataset's settings page and enter credentials for all data sources.
Cluster URI: WABI-INDIA-CENTRAL-A-PRIMARY-redirect.analysis.windows.net
Activity ID: 00000000-0000-0000-0000-000000000000
Request ID: ff70b198-de5a-4572-b36f-78858b062ef3
Time: 2024-12-09 05:52:16Z
Under the Data source credentials section in settings page I get this error:
Failed to test the connection to your data source. Please retry your credentials.Learn more
Settings Page
After this, I have to enter the credentials manually (after every request).
Is there any way to persist this credentials ?