Skip to main content

vw_workspace_access_details

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

Overview​

Namevw_workspace_access_details
TypeView
Iddatabricks_workspace.iamv2.vw_workspace_access_details

Fields​

The following fields are returned by this view:

NameDatatypeDescription
deployment_namestringWorkspace deployment name used to scope the query.
principal_idstringUnique identifier of the principal whose workspace access is being queried.
principal_typestringType of the principal (e.g. USER, GROUP, SERVICE_PRINCIPAL).
access_typestringHow the principal was granted access to the workspace (e.g. DIRECT, ACCOUNT_ADMIN).
statusstringCurrent access status of the principal on the workspace (e.g. ACTIVE).
account_idstringDatabricks account ID that owns the workspace.
workspace_idintegerNumeric identifier of the workspace.
permissionstringPermission level granted to the principal on the workspace (one row per permission, e.g. USER, ADMIN).

Required Parameters​

The following parameters are required by this view:

NameDatatypeDescription
deployment_namestringWorkspace deployment name used to scope the query.
principal_idstringUnique identifier of the principal whose workspace access is being queried.

SELECT Examples​

SELECT
deployment_name,
principal_id,
principal_type,
access_type,
status,
account_id,
workspace_id,
permission
FROM databricks_workspace.iamv2.vw_workspace_access_details
WHERE deployment_name = '{{ deployment_name }}'
AND principal_id = '{{ principal_id }}';

SQL Definition​

SELECT
wa.deployment_name,
wa.principal_id,
wa.principal_type,
wa.access_type,
wa.status,
wa.account_id,
wa.workspace_id,
p.value AS permission
FROM databricks_workspace.iamv2.workspace_access_details wa,
JSON_EACH(wa.permissions) p
WHERE wa.deployment_name = '{{ deployment_name }}'
AND wa.principal_id = '{{ principal_id }}'