Adding the "how" to the points above. What has scaled well for us is to grant only to account-level groups synced from the IdP, never to individual users. We manage both layers in Terraform: Unity Catalog grants for data, and workspace ACLs for warehouses, jobs and clusters. Then we use system tables to catch anything granted outside the code.
1. Groups from the IdP
Sync groups with SCIM, or with automatic identity management on Azure, at the account level and assign them to workspaces. Onboarding and offboarding then happen in Entra or Okta, and nothing changes in Databricks. Use service principals for jobs and CI.
2. Grants as code
resource "databricks_grants" "sales" {
schema = "main.sales"
grant {
principal = "data-analysts"
privileges = ["USE_SCHEMA", "SELECT"]
}
grant {
principal = "data-engineers"
privileges = ["USE_SCHEMA", "SELECT", "MODIFY", "CREATE_TABLE"]
}
}
resource "databricks_permissions" "bi_warehouse" {
sql_endpoint_id = databricks_sql_endpoint.bi.id
access_control {
group_name = "data-analysts"
permission_level = "CAN_USE"
}
}
databricks_grants is authoritative for that securable: on the next apply it removes any grant not in the code, which is what keeps UI changes from drifting. Use the singular databricks_grant if other teams also grant on the same object. Remember the group also needs USE_CATALOG on the parent catalog.
3. Audit for drift
-- direct grants to individual users (should return nothing)
SELECT grantee, table_catalog, table_schema, table_name, privilege_type
FROM system.information_schema.table_privileges
WHERE grantee LIKE '%@%';
-- who changed UC permissions recently
SELECT event_time, user_identity.email,
request_params.securable_full_name, request_params.changes
FROM system.access.audit
WHERE service_name = 'unityCatalog' AND action_name = 'updatePermissions'
AND event_date >= current_date() - 30;
Docs: https://docs.databricks.com/aws/en/data-governance/unity-catalog/manage-privileges/ and https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/grants