# Direct Access

**Direct Access** lets the Administrator manage, without leaving Power Monitor, who has access to a Fabric/Power BI artifact. Instead of editing permissions one by one in the portal, you register **rules** with the desired state (who should have which access) and click **Apply rules**: Power Monitor reads the current permissions, shows what will change in a confirmation and runs the changes with the organization's Service Principal. Every call is recorded in the tab's own **History**.

The feature appears as a tab in the details modal of four artifact types, all with the same structure (opening text, **Rules**, **History** and the **Apply rules** button):

| Tab | Where it is | What it manages |
| --- | --- | --- |
| **Direct access** | Semantic model modal, in *Governance › Semantic Models* and in the row menu of *Monitoring › Semantic Models* | Direct Power BI permissions on the model (Read, reshare and build) per user or group |
| **Manage access** | Gateway modal, in *Governance › Infrastructure › Gateways* and *Monitoring › Gateways*, and connection modal, in *Governance › Infrastructure › Connections* | Fabric roles on the gateway (ConnectionCreator, ConnectionCreatorWithResharing, Admin) and on the connection (User, UserWithReshare, Owner) |
| **OneLake roles** | Lakehouse modal, in *Governance › Storage* | OneLake data access roles: paths, actions and members of each role |
| **SQL permissions** | Warehouse modal, in *Governance › Storage* | Explicit T-SQL permissions (GRANT, DENY or removal) on schemas and objects |

**How to access:** open the artifact's details modal (by clicking the row or **⋮ › Open details**) and click the corresponding tab, in the pills at the top of the modal. The **Open details** submenu does not list these tabs.

**Who can use it:** exclusive to **Administrators**. For other profiles, the tab does not appear. It also does not appear when the artifact cannot be managed: personal gateways and connections, connections that exist only as an **In use** data source (no configured connection in Fabric) and artifacts without Fabric identifiers in the inventory.

{% hint style="warning" %}
**Sensitive data:** the rules and the history show names, e-mails and identifiers of users and groups. The **Hide data** button masks these values on screen. Be careful when copying, pasting or sharing screenshots and lists, especially when they involve customer data.
{% endhint %}

## What it is for

* **Grant and revoke access without opening the portal**: give a group Read on a semantic model, make someone the owner of a connection or create a OneLake role for a business area.
* **Keep access as agreed**: the rules store the desired state; when you apply again, Power Monitor fixes only what drifted from the rules.
* **Review before changing**: the confirmation shows how many changes will be made and which rules cannot be applied, with the reason.
* **Have an audit trail**: the **History** records every change sent, including the ones that failed, with the administrator who clicked **Apply rules**.

## How it works

The flow is the same in all four tabs:

1. **You register rules.** A rule describes the desired state (for example, "the Sales group must have Read on this model" or "the role salesReaders must exist with the path Tables/sales"). Saving or deleting a rule **changes nothing** in Fabric/Power BI.
2. **You click Apply rules.** Power Monitor reads the artifact's current permissions and compares them with the rules.
3. **You confirm.** If there is something to change, the confirmation window shows the change counts, the rules that will not be applied and the warnings. High-risk changes require ticking a confirmation box.
4. **The Service Principal applies.** The changes are run by the organization's Service Principal, never by your account. The result appears at the top of the **Rules** card and the **History** is reloaded.

{% hint style="info" %}
**Only what has a rule is changed.** Access that exists on the artifact but has no matching rule is informational only: Power Monitor **never removes it automatically**. To take access away, register a removal rule (for example, **Revoke**, **Remove role**, **The role must not exist** or **Absent (REVOKE)**).
{% endhint %}

## Features

### Rules

**What it is:** the **Rules** card, with the list of rules registered for the artifact and the **New rule** and **Apply rules** buttons in the header.

**What it is for:** recording who should have which access, to apply everything at once later.

**How to use:**

{% stepper %}
{% step %}
#### Create the rule

Click **New rule**. The form changes according to the tab (see each tab's section below): choose the user, group or role, the desired state and the access.
{% endstep %}

{% step %}
#### Save

Click **Save rule**. The rule is added to the list; nothing changes on the artifact yet.
{% endstep %}

{% step %}
#### Edit or delete when needed

Use **Edit** or **Delete** on the rule's row. When editing, the user, group or role is fixed (for another person or role, create another rule). Deleting asks for confirmation and warns that the current permission is not changed.
{% endstep %}
{% endstepper %}

**How it works:**

* With no rules, the list shows "No rules yet. Add a rule to be able to apply it." and the **Apply rules** button is disabled ("Add a rule to apply.").
* **Protected identities:** the Power Monitor Service Principal and the security group entered in **Group ID** ([Organization](../configuracoes/organizacao.md)) appear with the **Protected** badge and cannot have a rule. They are never changed by an apply.
* If a value saved in a rule is no longer available (for example, a role Fabric no longer offers), the form shows the value as *(unavailable)* and only lets you save after you pick a valid value.
* The user and group search queries Entra ID. Guests (B2B) may not show up in the search: in that case, enter the UPN or the object id, depending on the tab.

### Apply rules

**What it is:** the **Apply rules** button, next to **New rule**, in the header of the **Rules** card.

**What it is for:** bringing the artifact to the state described by the rules.

**How to use:**

1. Click **Apply rules**. While Power Monitor reads the current permissions, "Checking the current permissions..." is displayed.
2. If everything already matches the rules, "Nothing to apply: the permissions already match the rules." is displayed and nothing is sent.
3. If there are changes, the confirmation window opens (see the next section). Click **Confirm** to apply or **Cancel** to give up.

**How it works:**

* The current permissions are read **only when you click**, never when the tab opens.
* When some rules cannot be applied and the others already match, "Nothing to apply: the rules listed below cannot be applied, and the others already match the current permissions." is displayed, with the list of those rules and the reason for each.
* If the current permissions cannot be read (for example, the Service Principal has no access to the workspace), a panel shows the reason and what to do. This does **not** mean there is nothing to do: since the current state is unknown, nothing is applied. Fix the cause and click **Apply rules** again.
* If Power Monitor cannot identify the organization's Service Principal and security group, **Protected identities unavailable** is displayed and, for safety, nothing is applied.

### Confirmation and high-risk changes

**What it is:** the window opened by **Apply rules** when there is something to change, for example **Apply changes in Power BI?**, **Apply changes in Fabric?**, **Apply changes to the OneLake roles?** or **Apply changes to the SQL permissions?**.

**What it is for:** checking the size and the risk of the change before sending it.

**How to use:**

1. Read the counts sentence (for example, how many grants, updates and revocations will run, "by the Power-Monitor service principal").
2. Check the **Rules that will not be applied** section (up to 10 rules, with "and N more" when there are more), with the user, group or role, the desired access and the reason.
3. When the window shows **High-risk confirmation**, read the warning and tick the box. The **Confirm** button is only enabled after that.
4. Click **Confirm**.

**How it works:**

* **High risk:** in **OneLake roles**, changing **DefaultReader**, **DefaultReadWriter** or roles with item-permission members; in **SQL permissions**, any **DENY**. The box comes back unticked every time the window opens.
* **Your own access:** in **Manage access** and **SQL permissions**, actions that change your own access are flagged and run last, and the window says how many there are. Access you have **through a group** is not detected: removing or downgrading a group you belong to may also take away your access.
* **Per-apply limit:** each apply runs at most **50 actions**. When there are more, the window warns that only the first ones will run; the rest are **deferred** and processed the next time you click **Apply rules**.
* **New check before writing:** the permissions are read again at apply time. If they changed since the check, nothing is applied and the window reopens with the warning "The permissions changed since the check and nothing was applied; review again." and the updated counts.
* The window also reminds you that the apply runs as the Service Principal: in Fabric/Power BI, the changes appear in the audit under its name, and the Power Monitor history records which administrator clicked.

### Apply result

**What it is:** the **Apply result** panel, displayed at the top of the **Rules** card after the confirmation.

**What it is for:** knowing what was applied, what failed and why.

**How it works:**

* The title summarizes the result: "All *N* actions were applied.", **Partial apply** (with how many failed), "No action was applied: all *N* attempts failed." or "Nothing was applied: all *N* actions were deferred".
* The counts vary by tab (for example, **Granted**, **Updated**, **Revoked**, **Created**, **Deleted**, **Denied**, **Failed**, **Deferred**, **Blocked**) and each failure appears in a row with the user, group or role, the action and the message.
* **Forbidden (401/403)** failures mean the Service Principal lacks a role on the artifact; the message says which role and where to grant it (see [Required Service Principal permissions](#required-service-principal-permissions)).
* **Uncertain result:** if the apply does not respond as expected (for example, a dropped connection), some of the changes may have run. Check the **History** before clicking **Apply rules** again.
* Fabric, Power BI and OneLake may take a few minutes to reflect the changes; on the Warehouse, sessions that are already open may take some time.

### History

**What it is:** the **History** card, below the rules, with one row for **every call** an apply made to Fabric/Power BI, including the ones that failed.

**What it is for:** knowing who changed the access, when, what and with which result.

**How it works:**

* The columns are **Date**, **Action**, the affected user, group or role, **Change** (before and after), **Result** and **Applied by**. The total count appears in **Records**.
* **Applied by** shows the e-mail of the administrator who clicked **Apply rules**, with the **via service principal** badge: the change itself was made by the Power Monitor Service Principal.
* Results are color-coded: success in green; rate-limited (429), conflicts (409), changes detected before writing (412) and uncertain results in amber; failures in red.
* The history is reloaded after each apply and remains available even if the rule is deleted.

### Direct access tab (semantic models)

**What it is:** the **Direct access** tab of the semantic model modal (*Direct permissions of the semantic model*).

**What it is for:** granting or revoking direct Power BI permissions on the model, without relying on workspace roles.

**How to use:**

1. Open the model in *Governance › Semantic Models* (or through the **⋮** menu of *Monitoring › Semantic Models*) and click the **Direct access** tab.
2. Click **New rule** and choose the **Type**: **User** or **Group**.
3. Find the principal in **Search users in Entra ID** / **Search groups in Entra ID**. For users, you can also type the UPN in **Or type the user's UPN** (useful for B2B guests, who do not show up in the search). Groups must be picked from the search.
4. In **Desired action**, choose **Grant direct access** and the **Right**, or **Revoke direct access**.
5. Click **Save rule** and, when you want, **Apply rules**.

**How it works:**

* The rights that can be granted are the four the Power BI API allows: **Read**, **Read and reshare**, **Read and build** and **Read, reshare and build**. Write rights cannot be managed.
* **Revoke** removes only the direct permission. Access inherited from a workspace role (Admin, Member, Contributor or Viewer) remains and is not managed by this tab; rules that depend on it are not applied and must be adjusted in Power BI itself.
* When there is nothing to apply and part of the access comes from workspace roles, the screen reminds you: "The rest of the access to this model comes from workspace roles, which are not managed here."
* If the Service Principal has no role in the model's workspace, Power Monitor can still read the permissions through the admin APIs (read-only), but cannot change them: the screen explains it must be added to the workspace as Admin or Member.
* The tab does not appear in the modal opened from [Environment X-Ray](../qualidade-de-dados/raio-x-do-ambiente.md).

### Manage access tab (gateways and connections)

**What it is:** the **Manage access** tab, right after **Permissions**, in the gateway modal (*Fabric roles of this gateway*) and in the connection modal (*Fabric roles of this connection*).

**What it is for:** assigning, changing or removing Fabric roles on the gateway or the connection.

**How to use:**

1. Open the gateway in *Governance › Infrastructure › Gateways* or *Monitoring › Gateways*, or the connection in *Governance › Infrastructure › Connections*, and click the **Manage access** tab.
2. Click **New rule** and choose the **Type**: **User**, **Group** or **Service principal**.
3. Find the user or group in the search, or type the Entra ID object id in **Or enter the Entra ID object id**. Service principals do not show up in the search: enter the **Service principal object id** (the object id of the *Enterprise application*, not the app id).
4. Choose **Assign a role** and the **Role**, or **Remove the role**.
5. Click **Save rule** and then **Apply rules**.

**How it works:**

| Artifact | Roles (least to most privileged) |
| --- | --- |
| Connection | **User**, **User with resharing (UserWithReshare)**, **Owner** |
| Gateway | **Connection creator (ConnectionCreator)**, **Connection creator with resharing (ConnectionCreatorWithResharing)**, **Admin** |

* **Owner** (connection) and **Admin** (gateway) give full control and are flagged with a warning in the form.
* **The connection's last Owner and the gateway's last Admin are never removed or downgraded**, so the resource is never left without anyone to manage it. The rule appears in **Rules that will not be applied**.
* Admins of a connection's gateway have inherited access to it, which the connection API cannot remove: adjust it on the gateway itself.
* The neighboring **Permissions** tab shows a saved copy of the assignments. After applying, click **Refresh** there to see the new state.

### OneLake roles tab (Lakehouse)

**What it is:** the **OneLake roles** tab, the last tab of the Lakehouse modal (*OneLake data access roles of this Lakehouse*). Here the rule describes a whole **role**, not a person.

**What it is for:** creating, changing or deleting OneLake data access roles, defining which tables and folders each role sees and who the members are.

**How to use:**

{% stepper %}
{% step %}
#### Open the tab

In *Governance › Storage*, open a Lakehouse and click the **OneLake roles** tab.
{% endstep %}

{% step %}
#### Name the role

Click **New rule** and enter the **Role name**: letters and digits only, starting with a letter, up to 128 characters (no spaces, hyphens or underscores), for example *salesReaders*. The name cannot be changed later.
{% endstep %}

{% step %}
#### Choose the state

Select **The role must exist** to define the role, or **The role must not exist** to have it deleted from the Lakehouse when applying.
{% endstep %}

{% step %}
#### Define paths and members

In **Paths**, add `*` (whole item), `Tables/<table>`, `Tables/<schema>/<table>` or `Files/<folder or file>`; use the **Suggestions** to pick paths that already exist. In **Entra ID members**, add users and groups (by search or object id), service principals and managed identities (by object id). Optionally, in **Item-permission members**, give access to everyone who has a permission on an item.
{% endstep %}

{% step %}
#### Save and apply

Click **Save rule** and then **Apply rules**.
{% endstep %}
{% endstepper %}

**How it works:**

* **Role scope:** OneLake roles only restrict who reads the item as a Viewer or with the item Read permission. Workspace Admins, Members and Contributors still see all data.
* **Actions:** the only managed action today is **Read**.
* **Limits:** up to 100 paths, 500 Entra ID members and 20 item members per role. `*` cannot be combined with other paths.
* **Paths that do not exist yet:** the screen checks the paths against the Lakehouse's current content. A path that does not exist today gets the **Does not exist in the Lakehouse today** badge, and the confirmation says how many there are. This **does not block** the apply: the role is created anyway and grants access once the path is created. If the check is not possible (Lakehouse with too many items or read unavailable), the screen says so and you can still type any path.
* **High risk:** **DefaultReader**, **DefaultReadWriter** and roles with item-permission members change what every reader of the item sees. The rule shows the **High risk** badge and the apply requires the explicit confirmation.
* **Roles that are not rewritten:** roles with row- or column-level security (RLS/CLS) and roles with definitions the screen does not recognize are blocked, with the reason in the confirmation. Power Monitor's own identities that are members of a role are preserved automatically.
* **Invalid name:** rules saved with a name Fabric does not accept (with a hyphen or underscore, for example) show the **Invalid name in Fabric** badge and are never sent. Delete the rule and create another with a valid name.
* **OneLake security** must be enabled on the Lakehouse; otherwise, the screen warns you when applying.

### SQL permissions tab (Warehouse)

**What it is:** the **SQL permissions** tab, the last tab of the Warehouse modal (*T-SQL permissions of this Warehouse*).

**What it is for:** granting (GRANT), denying (DENY) or removing (REVOKE) explicit T-SQL permissions for users and groups on the Warehouse's schemas and objects.

**How to use:**

1. In *Governance › Storage*, open a Warehouse and click the **SQL permissions** tab.
2. Click **New rule** and choose the **User or group** (by search or by the Entra ID object id).
3. In **Schema or object**, choose the **Target type** (**Schema** or **Object**), the schema and, for objects, the object and the **Object type** (**Table**, **View**, **Procedure**, **Scalar function** or **Table-valued function**). The list of schemas and objects is only a helper: you can type a name that is not in it.
4. Choose the desired state: **Grant (GRANT)**, **Deny (DENY)** or **Absent (REVOKE)**, and tick the **Permissions** (up to 5 at a time).
5. Click **Save rule** and then **Apply rules**.

**How it works:**

| Target | Available permissions |
| --- | --- |
| Schema | SELECT, INSERT, UPDATE, DELETE, EXECUTE |
| Table | SELECT, INSERT, UPDATE, DELETE |
| View and table-valued function | SELECT |
| Procedure and scalar function | EXECUTE |

* The list groups the rules by user or group and target, with one tag per permission; **Add permissions** adds other permissions to the same group.
* The tab shows only **explicit** T-SQL permissions. Workspace roles and item permissions still apply and do not appear here. **Absent (REVOKE)** removes the explicit permission; access inherited from roles remains.
* **DENY takes precedence**: it blocks access even for those who would have it through a workspace role or item permission, including the ReadData of Viewers. That is why every DENY is high risk and requires the explicit confirmation.
* Schema and object names are case-sensitive. When applying, Power Monitor checks that the target exists and is of the given type; otherwise, the rule is blocked with the reason.
* System schemas (`sys`, `INFORMATION_SCHEMA`, `guest`, `queryinsights` and those starting with `db_`) cannot be used. `dbo` is allowed.
* Column-level permissions, database-wide permissions and permissions with GRANT OPTION (whose removal would require CASCADE) are not changed.
* Limit of 500 rules per Warehouse.
* When the Service Principal could not confirm the Warehouse's SQL address in Fabric, the screen shows **Cannot be applied**: the current permissions are read, but writing is refused until the Service Principal has access to the workspace.

## Required Service Principal permissions

All Direct Access reads and changes are made by the **organization's Service Principal**. The administrator's account is not used and no additional consent is requested. The Service Principal needs the role below on each artifact:

| Tab | Role the Service Principal needs | How to grant it |
| --- | --- | --- |
| **Direct access** | Admin or Member of the model's workspace | [Add Service Principal to Workspaces](../configuracoes/permissoes-adicionais.md#add-service-principal-to-workspaces) |
| **Manage access** (gateway) | Gateway Admin | [Grant Service Principal Access to Gateways](gateways.md#grant-service-principal-access-to-gateways) |
| **Manage access** (connection) | Connection Owner, or Admin of the bound gateway | [Grant Service Principal Access to Gateways](gateways.md#grant-service-principal-access-to-gateways) (gives Owner on connections without a gateway) |
| **OneLake roles** | Member (or higher) of the Lakehouse's workspace | [Add Service Principal to Workspaces](../configuracoes/permissoes-adicionais.md#add-service-principal-to-workspaces) |
| **SQL permissions** | Admin, Member or Contributor of the Warehouse's workspace (which gives CONTROL on the database) | [Add Service Principal to Workspaces](../configuracoes/permissoes-adicionais.md#add-service-principal-to-workspaces) |

* The **Add Service Principal to Workspaces** card makes the Service Principal an administrator of the workspaces, which covers the three tabs that depend on the workspace.
* The user and group search and the resolution of the names used in the Warehouse query Entra ID with the Service Principal: grant the user and group read permissions of the [Entra ID user import](../configuracoes/permissoes-adicionais.md#entra-id-user-import) card.
* When a role is missing, the tab itself says which one and where to grant it. Signing out and back in to Power Monitor does not fix it.

## Rules and behavior

* **Administrators only:** the tab appears only for Administrators and only on artifacts that can be managed.
* **Nothing changes until you apply:** creating, editing and deleting rules does not change the artifact. Deleting a rule also does not undo what it already applied.
* **Access without a rule is not touched:** Power Monitor never automatically removes access that has no rule.
* **Power Monitor identities are protected:** the Service Principal and the organization's security group are never changed.
* **Up to 50 actions per apply;** the rest is left for the next click on **Apply rules**.
* **Traceability:** besides each tab's **History**, creating, changing and deleting rules and each apply generate events in the *Configuration* category of the [Application Events](../auditoria/eventos-da-aplicacao.md) screen (for example, `DirectAccessRuleUpserted`, `DirectAccessRoleAssignmentPlanApplied`, `DirectAccessOneLakeRolePlanApplied` and `DirectAccessSqlPermissionPlanApplied`). In Fabric/Power BI, the changes appear under the Service Principal's name.

## Frequently asked questions

<details>

<summary>I do not see the tab in the artifact's modal.</summary>

The tab is exclusive to **Administrators**. It also does not appear on personal gateways and connections, on data sources that are only **In use** on the Connections screen, and on artifacts that do not have Fabric identifiers in the inventory yet (wait for the next scan). On the semantic model, the tab does not appear when the modal is opened from Environment X-Ray.

</details>

<details>

<summary>I deleted a rule, but the person still has access.</summary>

Deleting the rule does not change the current permission. To take access away, create a removal rule (**Revoke direct access**, **Remove the role**, **The role must not exist** or **Absent (REVOKE)**) and click **Apply rules**.

</details>

<details>

<summary>The apply failed with "Forbidden".</summary>

The Service Principal does not have the required role on the artifact. See [Required Service Principal permissions](#required-service-principal-permissions), grant the role and click **Apply rules** again.

</details>

<details>

<summary>Why does the rule appear in "Rules that will not be applied"?</summary>

The reason appears next to the rule. The most common cases are: the connection's last Owner or the gateway's last Admin, access inherited from a workspace or gateway role, a OneLake role with RLS/CLS, a schema or object that does not exist in the Warehouse (case matters) and a user or group that was not found in Entra ID.

</details>

<details>

<summary>I revoked the direct access, but the user can still open the model.</summary>

They probably have access through a workspace role or a group. The **Direct access** tab manages only the direct permission on the model; workspace roles are managed in [Workspaces](workspaces.md).

</details>

<details>

<summary>The result says "Uncertain result". What do I do?</summary>

The apply did not respond as expected and some changes may have run. Check the tab's **History** and only then click **Apply rules** again: Power Monitor rereads the current state and sends only what is still missing.

</details>

## Related pages

* [Semantic Models](modelos-semanticos.md#direct-access-tab)
* [Gateways](gateways.md#manage-access-tab)
* [Connections](conexoes.md#connection-modal-manage-access-tab)
* [Storage](armazenamento.md#onelake-roles-and-sql-permissions)
* [Workspaces](workspaces.md)
* [Additional Permissions](../configuracoes/permissoes-adicionais.md)
* [Application Events](../auditoria/eventos-da-aplicacao.md)
