Forum Discussion
devkeydet
8 years agoRegular Visitor
"Operation is not supported for selector" when using "Update datasources" REST API
I am trying to automate the publishing of a .pbix file, then change the "url" value of the OData datasource, in order to have a way to automation deployment from dev->test->prod. When I make an http...
v-ljerr-msft
Microsoft Employee
8 years agoHi devkeydet,
According to the documentation, we will get status 400 when:
- Body contains multiple requests with the same datasource selector.
- Missing or empty updateDetails in body.
- Attempting to update a datasource with invalid connection details.
- Datasource type doesn't support update operation.
- Attempting to update a connection from cloud to on-premises or on-premises to cloud.
In addition, could you try the solution below to see if it works in your scenario?
1. Use Query Parameter in Data Source dialogs(url) to create a the dataset, so that you can change the data source by just modifying the corresponding Parameter.
2. Use the the Set parameters operation(Power BI REST API) to dynamically change the Parameters in your code, which will also change the actual connection (url).
3. Use the Patch data source operation to update the credentials for the changed data source. Reference: https://community.powerbi.com/t5/Developer/Patching-an-Online-DirectQuery-datasource/m-p/351230
Regards