Skip to main content

workspace_assignment

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

Overview

Nameworkspace_assignment
TypeResource
Iddatabricks_account.iam.workspace_assignment

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
errorstringError response associated with a workspace permission assignment, if any.
permissionsarrayThe permissions level of the principal.
principalobjectInformation about the principal assigned to the workspace.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
workspace_assignment_listselectaccount_id, workspace_idfilter, max_results, page_tokenGet the permission assignments for the specified Databricks account and Databricks workspace.
workspace_assignment_updatereplaceaccount_id, workspace_id, principal_idCreates or updates the workspace permissions assignment in a given account and workspace for the
workspace_assignment_deletedeleteaccount_id, workspace_id, principal_idDeletes the workspace permissions assignment in a given account and workspace for the specified

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_idintegerThe ID of the user, service principal, or group.
workspace_idintegerThe workspace ID for the account.
filterstringFilter string to search principals.
max_resultsintegerMaximum number of permission assignments to return.
page_tokenstringPage token returned by previous call to retrieve the next page of results.

SELECT examples

Get the permission assignments for the specified Databricks account and Databricks workspace.

SELECT
error,
permissions,
principal
FROM databricks_account.iam.workspace_assignment
WHERE account_id = '{{ account_id }}' -- required
AND workspace_id = '{{ workspace_id }}' -- required
AND filter = '{{ filter }}'
AND max_results = '{{ max_results }}'
AND page_token = '{{ page_token }}'
;

REPLACE examples

Creates or updates the workspace permissions assignment in a given account and workspace for the

REPLACE databricks_account.iam.workspace_assignment
SET
permissions = '{{ permissions }}'
WHERE
account_id = '{{ account_id }}' --required
AND workspace_id = '{{ workspace_id }}' --required
AND principal_id = '{{ principal_id }}' --required
RETURNING
error,
permissions,
principal;

DELETE examples

Deletes the workspace permissions assignment in a given account and workspace for the specified

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