Forum Discussion
Problem with Refreshing Dataset after Parameter Change with Service Principal
Thanks lbendlin .
After the 'Takeover Dataset' step, I tried the Datasources Update endpoint
with 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?
Any solution for this?
- LJonesStripe1 year agoRegular Visitor
I raised an MS support ticket which made it through to the PowerBI 3rd line support team.
I was told this API endpoint is not actually designed for updating to a connection that already exists and there is currently no endpoint available for it. Which seems wild to me, it seems like exactly what it's for.
I gave up in the end
- lbendlin1 year agoSuper User
I would recommend you raise a DCR.
- fxs7576_0211 months agoHelper I
Hey LJonesStripe and jbauti10 , apology for the super late response on this.
I managed to find the solution to this using the following process:
- Create a gateway, and save its gateway_id.
- Take over the dataset from the original user to Service Principal. The Service Principal must the dataset owner to update the parameter. (POST endpoint)
- Update the parameter of the dataset (POST endpoint)
- Get the data source from the dataset, and retrieve its [gatewayId] (GET endpoint)
- If the gateway_id from step #1 is not the same as that from step #4, run this POST endpoint to bind the gateway. <--- For some reason this is required. Not sure why yet.
- Refresh the dataset to apply the parameter change to the dataset. (POST endpoint)
Let me know if it works on your end.