Hi @mzs,
Given that you’re on Azure Databricks + UC + AIM (no SCIM), here are some recommendations.
Firstly, I think that you should create/manage the group in Entra only. You should avoid creating the groups in Databricks directly. AIM treats Entra as the source of truth.
You can then programmatically activate the Entra group in Databricks (the UI’s GetOrCreateIdpGroup) using IAM v2.
Workspace-level endpoint (works from a job or from outside):
POST https://<workspace-host>/api/2.0/identity/groups/resolveByExternalId
Authorization: Bearer <workspace_admin_SP_OAuth_token>
Content-Type: application/json
{ "external_id": "<entra_group_object_id>" }
This ensures the Entra group exists as a Databricks principal (created if needed) and is referenceable by display name in the GRANT/UC APIs in that workspace.
You can create a schema and assign permissions with the same SP using REST
# Create schema
POST https://<workspace-host>/api/2.1/unity-catalog/schemas
Authorization: Bearer <token>
Content-Type: application/json
{
"name": "my_schema",
"catalog_name": "main",
"comment": "…"
}
GRANT USE SCHEMA ON SCHEMA main.my_schema TO `Example Entra Group`;
or UC grants API (/api/2.1/unity-catalog/permissions/…).
You can do this inside a Databricks job (recommended) by configuring a workspace-admin service principal for the workspace (minimal Databricks side privilege you need today to call IAM v2 + create schemas):
from databricks.sdk import WorkspaceClient
w = WorkspaceClient() # job runs as SP via OAuth
entra_group_id = "<entra_group_object_id>"
group_display_name = "Example Entra Group"
# 1. Activate group from Entra
w.iamv2.workspace_iam_v2.resolve_group_proxy(external_id=entra_group_id)
# 2. Create schema (if needed)
w.unity_catalog.create_schema(
name="my_schema",
catalog_name="main",
)
# 3. Grant to the group by display name
w.sql.statements.execute(
warehouse_id="<sql_warehouse_id>",
statement=f"GRANT USE SCHEMA ON SCHEMA main.my_schema TO `{group_display_name}`",
wait=True,
)
From outside Databricks you just trigger this job with the schema + group parameters.
In terms of privileges for the Databricks SP... For workspace, make it workspace admin (that’s currently the practical minimum to call identity/groups/resolveByExternalId, and create UC schemas). Fo unity catalog, grant this SP USE CATALOG and CREATE SCHEMA (and OWN/GRANT on the schema if you want it to manage further grants).
That gives you no account-admin SCIM or group-creation, groups fully owned in Entra and a single, limited-scope SP that can activate Entra groups via resolveByExternalId, create schemas, and run GRANTs, either as a Databricks job or from an external script using the same REST calls.
Try this out and let me know how it goes. If you encounter any issues, let me know.
If this answer resolves your question, could you mark it as “Accept as Solution”? That helps other users quickly find the correct fix.
Regards,
Ashwin | Delivery Solution Architect @ Databricks
Helping you build and scale the Data Intelligence Platform.
***Opinions are my own***