Forum Discussion
Update dataset datasource as in group via rest api with InvalidRequest code response
Hello,
I'm trying to update the data source in a dataset that is following microsoft instruction but unfortunately, I'm reveiving the error from api response. anybody can help me with this. here is my request and response. thank you so much.
Request:
uri: https://api.powerbi.com/v1.0/myorg/groups/groupid/datasets/datasetid/Default.UpdateDatasources
1 Reply
- AnonymousNot applicable
Hi quybmt2003
The request object looks ok to me.
A couple of things to check...The docs on this (and code that I have used in the past), has the ordering of the JSON defined differently. I would like to think that this wouldn't make a difference BUT you never know. It's worth trying placing the datasourceSelector above the connectionDetails object.
More importantly... changing a datasource can take time before it shows up in the Power BI service or API calls.
Is it possible that the data sources have been modified and it is subsequent update requests that are failing? I have hit this issue myself in the past. The documentation has often stated that it can take 30mins for a connection change to take effect.
In my experience - it is much faster than this.
You can use this endpoint to fetch the current connection details: https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/getdatasourcesingroup