Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
We are using parameters to change our database dynamically in reports deployed to the Power BI service. It works great. Now I'd like to be able to do more through API calls as opposed to manually updating things in the service.
I'm using Postman for all my testing and can authenticate, and get a token, list groups, reports, and datasets, and even dataset parameters no problem, but when trying to make a call to update the parameter values I get an error, and I can't find any information about it.
Once authenticated I'm making the following call
with a json body of
{ "updateDetails": [ { "name": "DatabaseServer", "newValue": "xyz" }, { "name": "DatabaseName", "newValue": "123" } ] }
and it returns:
{ "error": { "code": "InvalidRequest", "message": "This operation is only supported for the dataset owner" } }
which I don't really understand as I am the dataset owner
Solved! Go to Solution.
My guess is that you are NOT the same user when you use the APIs, as when you login to the portal. You probably are within the same tenant/group (as you can see the data), but not allowed to modify datasets in the way the owner can.
Do other “Write” APIs work for you? For example Update Datasources (see https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/updatedatasources)? I think you will get the same error.
You can try (via API, with the same authentication you do) to Take Over the dataset (https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/takeoveringroup) after that, you should be able to execute Update parameters. Also, if you then get into the Portal UI (with the original credentials you use now) and go to the Schedule Refresh page of the dataset, you will see who the owner is now (once you are not the owner, a line appears there saying “the dataset has been configured by …….. Would you like to take over the setting?”
Also, in the future when you post a request/response, please paste the entire raw data (you can remove the authentication token…) so we can see the request Id etc. and if necessary, investigate in our internal logging.
My guess is that you are NOT the same user when you use the APIs, as when you login to the portal. You probably are within the same tenant/group (as you can see the data), but not allowed to modify datasets in the way the owner can.
Do other “Write” APIs work for you? For example Update Datasources (see https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/updatedatasources)? I think you will get the same error.
You can try (via API, with the same authentication you do) to Take Over the dataset (https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/takeoveringroup) after that, you should be able to execute Update parameters. Also, if you then get into the Portal UI (with the original credentials you use now) and go to the Schedule Refresh page of the dataset, you will see who the owner is now (once you are not the owner, a line appears there saying “the dataset has been configured by …….. Would you like to take over the setting?”
Also, in the future when you post a request/response, please paste the entire raw data (you can remove the authentication token…) so we can see the request Id etc. and if necessary, investigate in our internal logging.
As obvious as it should have been you were indeed right. I was publishing reports to a workspace owned by another account. The other account can not act on them through the API until ownership is transfered
Hi,
I am facing the same issue, were you able to resolve this?
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
13 | |
2 | |
2 | |
1 | |
1 |
User | Count |
---|---|
20 | |
3 | |
2 | |
2 | |
2 |