Forum Discussion
How to audit RLS (DMVs) via XMLA in Fabric/Power BI without being the "Dataset Owner"?
Hi everyone,
I am building a centralized audit tool in Microsoft Fabric to extract RLS configurations (Roles, Members, and DAX Filter Expressions) across multiple workspaces. My goal is to create a script that any authorized Auditor or Workspace Admin can run, regardless of who originally created the model.
The Problem: I am using a Python Notebook with the sempy.fabric library. The script works perfectly if I am the Owner of the semantic model. However, if I am a Workspace Administrator but NOT the original creator/owner, the engine blocks the metadata read.
import sempy.fabric as fabric
import pandas as pd
workspace_id = "..."
# I am a Workspace Admin, but a colleague created this model
modelo_nombre = "..."
try:
# Querying the DMVs for Roles, Memberships and Table Permissions
df_roles = fabric.evaluate_dax(modelo_nombre, "SELECT * FROM $SYSTEM.TMSCHEMA_ROLES", workspace=workspace_id)
df_usuarios = fabric.evaluate_dax(modelo_nombre, "SELECT * FROM $SYSTEM.TMSCHEMA_ROLE_MEMBERSHIPS", workspace=workspace_id)
df_reglas = fabric.evaluate_dax(modelo_nombre, "SELECT * FROM $SYSTEM.TMSCHEMA_TABLE_PERMISSIONS", workspace=workspace_id)
print("Extraction successful")
except Exception as e:
print(f"Error: {e}")
The Error: AdomdErrorResponseException: User '<my_email>' needs to be an administrator to read the metadata of the database '6b4e132c-...'
Technical Details:
Environment: Fabric F64 Capacity.
Permissions: I have Admin role in the workspace and Build permissions on the dataset.
XMLA Endpoint: Enabled (Read Write).
Crucial Observation: When the Original Creator runs this exact code, it works. When I (Admin) run it, it fails with the "needs to be an administrator" error.
What I need to know:
Why does the Analysis Services engine require "Ownership" or fail to recognize the Workspace Admin role for DMV queries via XMLA?
Is there a way to allow non-owners (but Admins) to read these system tables?
Would using a Service Principal bypass this "Owner" requirement?
I need a solution that doesn't require me to "Take Over" every model, as that would break existing scheduled refreshes and credentials.
Thanks in advance!
Hi Anonymous ,
Thanks for reaching out to Microsoft Fabric Community.The behavior you are seeing is expected. DMV queries such as $SYSTEM.TMSCHEMA_ROLES require Analysis Services database admin permissions because they expose internal model metadata, including RLS definitions.
Although Workspace Admin, Member, and Contributor roles normally map to database admin permissions for semantic models, this behavior changes if the tenant setting “Block republish and disable package refresh” is enabled. When that setting is turned on, only the semantic model owner is treated as database admin for XMLA discovery and metadata access. Non-owners, even if they are Workspace Admins, are treated as database readers.
If the setting is disabled, Workspace Admins should be able to query these DMVs without taking over the model.
You may want to confirm the status of the tenant setting with your Power BI or Fabric administrator, as that will determine the expected behavior in this case.
Hope this helps. Please reach out for further assistance.
Thank you.
3 Replies
- v-veshwara-msftCommunity Support
Hi Anonymous ,
Thanks for reaching out to Microsoft Fabric Community.The behavior you are seeing is expected. DMV queries such as $SYSTEM.TMSCHEMA_ROLES require Analysis Services database admin permissions because they expose internal model metadata, including RLS definitions.
Although Workspace Admin, Member, and Contributor roles normally map to database admin permissions for semantic models, this behavior changes if the tenant setting “Block republish and disable package refresh” is enabled. When that setting is turned on, only the semantic model owner is treated as database admin for XMLA discovery and metadata access. Non-owners, even if they are Workspace Admins, are treated as database readers.
If the setting is disabled, Workspace Admins should be able to query these DMVs without taking over the model.
You may want to confirm the status of the tenant setting with your Power BI or Fabric administrator, as that will determine the expected behavior in this case.
Hope this helps. Please reach out for further assistance.
Thank you.- v-veshwara-msftCommunity Support
Hi Anonymous ,
Just wanted to check if the response provided was helpful. If further assistance is needed, please reach out.
Thank you.
- v-veshwara-msftCommunity Support
Hi Anonymous ,
We wanted to kindly follow up regarding your query. If you need any further assistance, please reach out.
Thank you.