Skip to main content

workspace_assignment_details

Creates, updates, deletes, gets or lists a workspace_assignment_details resource.

Overview

Nameworkspace_assignment_details
TypeResource
Iddatabricks_account.iamv2.workspace_assignment_details

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
account_idstringThe account ID parent of the workspace where the principal is assigned
principal_idintegerThe internal ID of the principal (user/sp/group) in Databricks.
workspace_idintegerThe workspace ID where the principal is assigned
effective_entitlementsarrayThe principal's full effective entitlements granted in this workspace: every entitlement it holds whether granted directly or via group membership. Populated on Get; empty on List.
entitlementsarrayEntitlements granted directly to the principal on this workspace. The only client-settable field: create and update manage exactly this set (including entitlements the principal also holds via a group). Not populated by ListWorkspaceAssignmentDetails (omitted for scalability); call GetWorkspaceAssignmentDetail to read the entitlements for a single principal.
principal_typestringThe type of the principal (user/sp/group). (GROUP, SERVICE_PRINCIPAL, USER)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectaccount_id, workspace_id, principal_idReturns the assignment details for a principal in a workspace.
listselectaccount_id, workspace_idpage_size, page_tokenLists workspace assignment details for a workspace. For scalability, the response omits the
createinsertaccount_id, workspace_id, workspace_assignment_detailCreates a workspace assignment detail for a principal. Entitlement grants are applied individually and
updateupdateaccount_id, workspace_id, principal_id, update_mask, workspace_assignment_detailUpdates the entitlements of a directly assigned principal in a workspace. Entitlement changes are
deletedeleteaccount_id, workspace_id, principal_idDeletes a workspace assignment detail for a principal, revoking all associated entitlements.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
account_idstring
principal_idintegerRequired. ID of the principal in Databricks to delete workspace assignment for.
update_maskobjectRequired. The list of fields to update.
workspace_idintegerThe workspace ID where the principal has access.
page_sizeintegerThe maximum number of workspace assignment details to return. The service may return fewer than this value.
page_tokenstringA page token, received from a previous ListWorkspaceAssignmentDetails call. Provide this to retrieve the subsequent page.

SELECT examples

Returns the assignment details for a principal in a workspace.

SELECT
account_id,
principal_id,
workspace_id,
effective_entitlements,
entitlements,
principal_type
FROM databricks_account.iamv2.workspace_assignment_details
WHERE account_id = '{{ account_id }}' -- required
AND workspace_id = '{{ workspace_id }}' -- required
AND principal_id = '{{ principal_id }}' -- required
;

INSERT examples

Creates a workspace assignment detail for a principal. Entitlement grants are applied individually and

INSERT INTO databricks_account.iamv2.workspace_assignment_details (
workspace_assignment_detail,
account_id,
workspace_id
)
SELECT
'{{ workspace_assignment_detail }}' /* required */,
'{{ account_id }}',
'{{ workspace_id }}'
RETURNING
account_id,
principal_id,
workspace_id,
effective_entitlements,
entitlements,
principal_type
;

UPDATE examples

Updates the entitlements of a directly assigned principal in a workspace. Entitlement changes are

UPDATE databricks_account.iamv2.workspace_assignment_details
SET
workspace_assignment_detail = '{{ workspace_assignment_detail }}'
WHERE
account_id = '{{ account_id }}' --required
AND workspace_id = '{{ workspace_id }}' --required
AND principal_id = '{{ principal_id }}' --required
AND update_mask = '{{ update_mask }}' --required
AND workspace_assignment_detail = '{{ workspace_assignment_detail }}' --required
RETURNING
account_id,
principal_id,
workspace_id,
effective_entitlements,
entitlements,
principal_type;

DELETE examples

Deletes a workspace assignment detail for a principal, revoking all associated entitlements.

DELETE FROM databricks_account.iamv2.workspace_assignment_details
WHERE account_id = '{{ account_id }}' --required
AND workspace_id = '{{ workspace_id }}' --required
AND principal_id = '{{ principal_id }}' --required
;