Tutorial: Use an RBAC role for workspace administration
Use role-based access control (RBAC) to separate everyday work from tasks that require workspace admin permissions in Databricks. Users assume an admin role when needed and return to their user identity afterward, keeping administrative permissions out of their everyday sessions.
Scenario
The site reliability engineers (SREs) in sre-team have standing workspace admin access through direct or inherited membership in the workspace's admins system group. You create an empty role-workspace-admin group, grant sre-team permission to assume it, and add the role to admins.
After testing the role, you remove standing admin access for the SREs you're moving to the role while preserving their everyday workspace access. Other workspace administrators keep their existing access. SREs choose when to assume the role and when to switch back. This setup does not configure approval workflows or automatic expiry of elevated access.
Prerequisites
- A workspace enabled for identity federation, with RBAC enabled. See Enable RBAC.
- Account admin or workspace admin permissions to create the role, grant the Assume permission, and assign it to the workspace. See Who can manage groups?.
- Workspace admin permissions to manage the workspace's
adminsgroup and entitlements. - An account group containing the SREs you want to configure. This tutorial uses
sre-team. Substitute your own group name throughout. - An SRE from
sre-teamwho can participate in validation using their own sign-in, separate from the administrator making the configuration changes. - An audit reader with access to
system.access.audit. If the test workspace is not enabled for Unity Catalog, use a Unity Catalog-enabled workspace in the same account and cloud region to query audit events. See Verify audit attribution.
Step 1: Create the role
For this tutorial, create an empty account group to serve as the role.
- Account console
- Workspace admin settings
- As an account admin, log in to the account console.
- In the sidebar, click User management.
- On the Groups tab, click Add group.
- Enter
role-workspace-admin. Do not add members. - Click Confirm.
- Assign the group directly to the workspace with Workspace access. See Assign a group to a workspace.
- As a workspace admin, log in to the test workspace.
- Click your username in the top bar and select Settings.
- Click the Identity and access tab.
- Next to Groups, click Manage.
- Click Add Group, then Add new.
- Enter
role-workspace-adminand select Workspace access. - Click Add. Do not add members.
This also assigns the group directly to the workspace and grants you Manage permission on it.
Keep this role empty. After you add the role to admins, a member of the role inherits workspace admin permissions as their user identity.
Manage permission allows changes to the role's membership and grants of the Assume permission. Review the role's Permissions tab and limit Manage to the administrators responsible for controlling access to it. If account admins should control this role, create it in the account console to avoid automatically granting Manage to a workspace admin. See Who can manage groups?.
Create a separate admin role for each workspace so that permission to assume one role does not grant administration in multiple workspaces.
Step 2: Grant the SREs permission to assume the role
Grant the Assume permission to sre-team using either method:
- Account console
- Workspace admin settings
- As an account admin, open the account console and click User management.
- On the Groups tab, click
role-workspace-admin. - Click the Permissions tab, then click Grant access.
- Search for and select
sre-team, select Assume, and click Save.
- As a workspace admin with Manage permission on the role, open Settings > Identity and access in the test workspace.
- Next to Groups, click Manage, then select
role-workspace-admin. - Click Permissions, then Grant access.
- Search for and select
sre-team, select Assume, and click Save.
Members of sre-team can now assume the role. To change who can assume it, manage this group's membership or its grant of the Assume permission. When you withdraw access, check for other grants or memberships that also permit the user to assume the role.
Step 3: Add the role to the workspace's admin group
As a workspace admin, add the role to admins:
- In the workspace, click your username in the top bar and select Settings.
- Click Identity and access.
- Next to Groups, click Manage.
- Select
admins. - On the Members tab, click Add members.
- Select
role-workspace-admin, then click Confirm.
The role inherits workspace admin permissions from admins. The SREs have permission to assume this role without being members of it.
Step 4: Check role access and everyday access
Before you change standing admin access, one of your SREs signs in to the workspace with their own account and completes these checks:
- Click the workspace name in the top bar and hover over the current workspace.
- Select
role-workspace-adminfrom the role switcher. - Verify that the workspace reloads with the role name under the workspace name.
- Open Settings > Identity and access, then click Manage next to Groups. Verify that you can open the
adminsgroup's Members tab. This check does not require changing any membership. - Return to the role switcher and select your username.
As the workspace admin, also verify that sre-team is assigned to the workspace with the access entitlements its members need for everyday work:
- Workspace access: Grants access to core workspace features such as notebooks, jobs, models, and pipelines.
- Databricks SQL access: Grants access to Databricks SQL features, including dashboards, queries, and SQL warehouses.
If the SREs receive these entitlements only through admins, grant them to sre-team explicitly. This preserves their everyday access after you remove standing admin membership. See Access entitlements.
Step 5: Remove the selected SREs' standing admin access
As the workspace admin, review the selected SREs' direct and inherited membership in admins:
- Open Settings > Identity and access > Groups > Manage.
- Open
admins, then its Members tab. - Remove the selected SREs' direct memberships and remove
sre-teamif it is a direct member. Keeprole-workspace-adminand unrelated administrators. - Check for other groups the selected SREs belong to, including those groups' parent groups, that still give them admin access. If a shared group also contains people who must retain admin access, give those people admin access another way before you remove the shared group from
admins. Changing account-group membership can also affect access outside this workspace.
Keep the SREs' everyday workspace assignments and the grant of the Assume permission from Step 2. Removing standing admin access requires addressing each path into admins, not just a single direct membership.
Step 6: Verify elevation and return
After you remove standing admin access, the same SRE verifies these results in their browser session:
- While acting as your user identity, refresh the workspace and verify that the workspace admin settings checked in Step 4 are unavailable.
- Use the role switcher to assume
role-workspace-admin. - Verify that you can open those admin settings and view the
adminsgroup's members. - After finishing the administrative task, use the role switcher to select your username.
- Verify that those admin settings are unavailable again. Your everyday workspace access remains available.
Switching back changes the identity used by this browser session. It doesn't change a separately authenticated Databricks CLI profile or revoke its tokens. The admin role owns any assets that you create while acting as the role.
Step 7: Verify audit attribution
To inspect activity under the admin role, run this query as the audit reader. Replace <workspace-id> with the ID of the test workspace:
SELECT event_time, service_name, action_name,
identity_metadata.run_by, identity_metadata.run_by_display_name,
identity_metadata.run_as, identity_metadata.run_as_display_name
FROM system.access.audit
WHERE workspace_id = '<workspace-id>'
AND identity_metadata.run_as_display_name = 'role-workspace-admin'
AND event_date >= current_date() - INTERVAL 1 DAY
ORDER BY event_time DESC;
Check the events for the SRE's test session. identity_metadata.run_by identifies the SRE who initiated each request, and run_as identifies the admin role used for authorization. The query filters on run_as_display_name, the role's human-readable name. Audit data is updated throughout the day, so a recent event might not appear immediately. See Identity metadata reference.
Optional: Use separate Databricks CLI profiles
To perform administrative work with the Databricks CLI, authenticate separately for everyday and admin work. The token-management check in this section requires personal access tokens to be enabled and token management to be available in the workspace. See Monitor and revoke personal access tokens.
The participating SRE installs the Databricks CLI as described in Install or update the Databricks CLI. They log in using their own sign-in, with a named profile for everyday work and another for the admin role:
databricks auth login --host <workspace-url> --profile everyday
databricks auth login --host <workspace-url> --profile ws-admin
For everyday, the SRE selects their user identity under Authorize as.. in the browser. For ws-admin, they select role-workspace-admin.
The SRE compares this read-only admin command using each profile:
databricks token-management list --profile everyday
databricks token-management list --profile ws-admin
The everyday profile receives a permission error. The admin profile can list the token metadata. The SRE uses --profile everyday for subsequent everyday commands. Selecting that profile does not invalidate the admin profile. See Databricks CLI.
Clean up
Keep the configuration if it is the access model you intend to use. For a temporary test, restore the SREs' original admin memberships before removing the role from admins or withdrawing the Assume permission. Review any assets owned by the role before deleting it.
Next steps
-
- Switch RBAC roles
- Use other supported methods to assume a role.
-
- Role-based access control (RBAC) limitations
- Check which features are unsupported or behave differently when acting as a role.
-
- Manage Databricks groups
- Manage group membership, workspace assignments, and the Assume permission.