Forum Discussion
Trying to get roles needed for an RLS report using the APi
- 11 months ago
Hi,
Sorry for the late response. What I ended up doing was a combination of steps: I used the workspace analysis with the dataset to get the full list of roles on the report and who’s assigned to them. Since I already had the user’s email and the AD groups, I just compared them and pulled out the matches.
https://learn.microsoft.com/en-us/rest/api/power-bi/admin/workspace-info-post-workspace-info
https://learn.microsoft.com/en-us/rest/api/power-bi/admin/workspace-info-get-scan-result
You can enumerate RLS roles in a semantic model via DMV queries.
select * from $SYSTEM.TMSCHEMA_ROLES
- luish_castroc1 year agoRegular Visitor
Thanks for the response, im not familiar with that process since i'm using the powerbi REST api
- lbendlin1 year agoSuper User
You can run a DMV query through the REST API.
Datasets - Execute Queries In Group - REST API (Power BI Power BI REST APIs) | Microsoft Learn
- luish_castroc1 year agoRegular Visitor
thanks but as per the documentation on the api that won't work:
Service Principals aren't supported for datasets with RLS per RLS limitations or datasets with SSO enabled.
im using a service principal.