Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
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 post to:
https://api.powerbi.com/v1.0/myorg/groups/{valid-group-id}/datasets/{valid-dataset-id}/updatedatasou...
...with the following body:
{
"updateDetails":[
{
"connectionDetails":
{
"url": "https://new-value.api.crm.dynamics.com/api/data/v8.2"
},
"datasourceSelector":
{
"datasourceType": "OData",
"connectionDetails":
{
"url":"https://old-value.api.crm.dynamics.com/api/data/v8.2"
}
}
}
]
}
...the status is 400 with an "Operation is not supported for selector". However, according to my interpretation of https://msdn.microsoft.com/en-us/library/mt814715.aspx this should be supported. Any thoughts on why I am getting this error?
Hi @devkeydet,
According to the documentation, we will get status 400 when:
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
Hi,
After looking around quite intensely, I believe there isn't an actual answer to the problem posed in this thread. At the moment I'm facing the same issue and am getting especially frustrated with the lack of more in depth information from the REST API.
I have a report that works just fine and for which the datasource can be changed when using the Power BI Desktop app. However trying to accomplish the same using the REST API's is failing.
I'm switching between practically identical databases, both cloud and both authenticated using Basic auth.
The body is (a bit redacted):
{
"updateDetails": [
{
"datasourceSelector": {
"datasourceType": "Sql",
"connectionDetails": {
"server": "server-one.database.windows.net",
"database": "server-one-database-db"
}
},
"connectionDetails": {
"server": "server-two.database.windows.net",
"database": "server-two-database-db"
}
}
]
}
The response I'm receiving is as follows:
{
"error": {
"code": "InvalidRequest",
"message": "Operation is not supported for selector #23"
}
}And... well, that's it actually.
From the datasources fetch from the gateway they are listed as, from which I concluded they are authenticated just fine.
{
"id": "<uuid>",
"gatewayId": "<uuid of cloud gw>",
"datasourceType": "Sql",
"connectionDetails": "{\"server\":\"server-two.database.windows.net\",\"database\":\"server-two-database-db\"}",
"credentialType": "Basic",
"credentialDetails": {
"useEndUserOAuth2Credentials": false
}
},{
"id": "<uuid>",
"gatewayId": "<uuid of cloud gw>",
"datasourceType": "Sql",
"connectionDetails": "{\"server\":\"server-one.database.windows.net\",\"database\":\"server-one-database-db\"}",
"credentialType": "Basic",
"credentialDetails": {
"useEndUserOAuth2Credentials": false
}
}
Why would it be possible to switch datasources using the desktop app, but fail to do so using the REST API?
Is there a way to get a little bit more information from the API?
Regards,
Peter
I am facing the same exact issue right now. Did you get any traction?? @v-ljerr-msft @petermoolenaar
Hi @TexasBI ,
Eventually, support (after some escallation) was able to provide more details and (if memory serves me right) it turned out to be a column which combined (joined) information from tables. The documentation tells that combining information from different sources might be a problem, but apparantly any join could prove to be giving issues.
Regards,
Peter
I am geeting the same error when I select Update all datasources in workspace.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |