Dear All,
Using a Terraform workspace-level provider, I am trying to add an Entra Id group to the account, and then assign permissions to the group.
The Terraform provider runs in the context of an Entra Id user account with workspace admin permissions, and without account admin permissions.
The following code successfully adds the group to the workspace:
resource "databricks_group" "users" {
display_name = "Entra Id group name"
external_id = "Entra Id group object id"
}
Then, to assign User permissions on the workspace to the group:
resource "databricks_permission_assignment" "workspace_user" {
principal_id = databricks_group.users.id
permissions = ["USER"]
}
The Terraform PLAN phase does as expected, but then in the apply phase, I get the error "Error: cannot create permission assignment: Principal not found in account." That is, I can register the group, but I cannot read account level metadata about the group.
The above is consistent with what I see in the workspace Settings/Identity and access/Groups panel: I can add a group to the Workspace. But if I afterwards click the group to see group information, I get the error: "Call failed to /ajax/...: Group with id XXXXXX not found, ...".
Any ideas on how I can make this work?
Further context:
- In my Databricks account, I have "Automatic identity management" enabled.
- The account I use when running Terraform is Workspace admin but not Databricks Account admin.
- I can make it work if I run the Terraform code with Databricks account admin permissions and using an account level provider to register the Entra Id group, it works. However, this is not an option for me in production.
BR,
Sรธren