Forum Discussion
Recieving (403) Forbidden when Accessing Dataset via API
Hi, yes,
This might sound weird but please remove the Grant admin consent to the permissions. That's a permission for tenant only that can produce error for regular api requests.
Also add Dataset.ReadWrite.All to keep both permissions for dataset.
Just in case, let's sync something. You are using executeQueries. The request is asking for DAX Query in "My Workspace". If you want to query a dataset in a workspace you must use executeQueries in Group.
Please test "Get Datasets in Group" and let us know if that one works.
Make sure you are not breaking a limitation: https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/execute-queries-in-group#limitations
Regards.
- MikeFleming2 years agoRegular Visitor
Hi,
I removed the consent, but same
I wasnt aware that was asking for queries in My Workspace. This has worked before with the same code. But I will check that out, and also try the other call you mentioned. I will also revisit the limitations.
Thanks
- MikeFleming2 years agoRegular Visitor
It is a limitation! RLS has been enabled.
"Service Principals aren't supported for datasets with RLS per RLS limitations or with SSO enabled."
I will need to find another way to connect.
Thanks for pointing that out.
- ibarrau2 years agoSuper User
Alright! it's good to know you find it. Remember you can use the API with username and password instead of secret. I think that might work for RLS.
I hope that helps,