setup_rls_and_roles
Configure Row-Level Security roles and DAX filter expressions in TMDL models, validate security rules against sample queries, and roll back changes if tests fail.
Instructions
Configure Row-Level Security (RLS) roles and validation rules in a TMDL model.
Use this tool when the user asks to:
Set up, add, or configure RLS roles and DAX table filter expressions.
Test and validate security rules against sample queries (optional live dataset).
Args: target: Target PBIP directory or TMDL path. spec_yaml: YAML specification of security roles, members, and DAX filters. spec_json: JSON specification (either as a string or a structured object/dict). dry_run: If True, validate role specification without writing to disk. rollback_on_test_failure: Whether to revert modifications if test queries fail. workspace_id: Optional Power BI workspace ID for live RLS EffectiveIdentity checks. dataset_id: Optional Power BI dataset ID for live RLS checks. auth_mode: Optional auth mode ("interactive", "service_principal", "managed_identity"). tenant_id: Optional Azure AD tenant ID. client_id: Optional Azure AD client ID. fabric_client: Optional injected FabricClient (for testing).
Returns: Dict with roles created, test query outcomes, and rollback status if applicable.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"target": "<target>"
},
"name": "setup_rls_and_roles"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target | Yes | ||
| dry_run | No | ||
| auth_mode | No | ||
| client_id | No | ||
| spec_json | No | ||
| spec_yaml | No | ||
| tenant_id | No | ||
| dataset_id | No | ||
| workspace_id | No | ||
| fabric_client | No | ||
| rollback_on_test_failure | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||