Forum Discussion
Problem with Refreshing Dataset after Parameter Change with Service Principal
Hi PowerBI Community,
I have a few semantic models (sourced from AWS/GCS and not via. Gateway) that are not owned by Service Principal. My goal is to programmatically change some parameters that the semantic models are using and then apply the change, and these are the steps I took:
- Take over the dataset from the original user to Service Principal. The Service Principal must the dataset owner to update the parameter. (endpoint)
- Update the parameter of the dataset (endpoint)
- Refresh the dataset to apply the parameter change to the dataset. (endpoint)
But on step 3, I always receive the following message, and most of the dataset settings are greyed out.
"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."
Does anyone know another way to change and apply the new parameter using REST API, or solve the refresh issue on step 3 (maybe allowing Service Principal to refresh any semantic models regardless of the ownership in the workspace)?
Best regards
10 Replies
- lbendlinSuper User
Your process is missing a step. After a semantic model takeover all data source credentials are removed and need to be reapplied.
Datasets - Update Datasources In Group - REST API (Power BI Power BI REST APIs) | Microsoft Learn
- fxs7576_02Helper I
Thanks lbendlin .
After the 'Takeover Dataset' step, I tried the Datasources Update endpointwith the following request body:
{ 'updateDetails': [ {'datasourceSelector': { 'datasourceType': 'MySql', 'connectionDetails': { 'server': 'demo_server_01', 'database': 'demo_database_01' } }, 'connectionDetails': { 'server': 'demo_server_01', 'database': 'demo_database_01' } } ] }
But received the following message:{"error":{"code":"InvalidRequest","message":"The given connection details for selector # are invalid"}}Is there any information in the request body that I need to add or modify?
- LJonesStripeRegular Visitor
Did you ever manage to find the solution to this?
- AnonymousNot applicable
Hi fxs7576_02 ,
Base on your description, it sounds like you're running into an issue with data source credentials after you update the parameters and try to refresh the dataset. Please check if the service principal hit the following limitations:
In addition, the following link is the one which has the similar problem as yours. Hope its solution can help you solve the problem.
Solved: Dataset refresh error Service principal - Microsoft Fabric Community
Best Regards
- fxs7576_02Helper I
Hi Anonymous ,
I don't think the Service Principal is facing those limitations.
When I looked at the solution in Solved: Dataset refresh error Service principal - Microsoft Fabric Community thread, they used the endpoint to update the datasource credential for Gateway.
$BounGateway=Invoke-PowerBIRestMethod -Url "groups/$($workspace.id)/datasets/$($datasetid)/Default.GetBoundGatewayDataSources" -Method GET | ConvertFrom-Json
I'm not yet familiar with gateway connection. Is the above endpoint still relevant if I use a personal cloud connection (i.e. RDS MySQL) as opposed to gateway?