Skip to main content

vw_service_principal_entitlements

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

Overview

Namevw_service_principal_entitlements
TypeView
Iddatabricks_workspace.iam.vw_service_principal_entitlements

Fields

The following fields are returned by this view:

NameDatatypeDescription
deployment_namestringWorkspace deployment name used to scope the query.
idstringUnique identifier for the service principal.
displayNamestringHuman-readable display name of the service principal.
applicationIdintegerApplication ID of the service principal.
activebooleanWhether the service principal is active.
entitlementstringEntitlement granted to the service principal (one row per entitlement, e.g. workspace-access, databricks-sql-access, allow-cluster-create).

Required Parameters

The following parameters are required by this view:

NameDatatypeDescription
deployment_namestringWorkspace deployment name used to scope the query.

SELECT Examples

SELECT
deployment_name,
id,
displayName,
applicationId,
active,
entitlement
FROM databricks_workspace.iam.vw_service_principal_entitlements
WHERE deployment_name = '{{ deployment_name }}';

SQL Definition

SELECT
sp.deployment_name,
sp.id,
sp.displayName,
sp.applicationId,
sp.active,
JSON_EXTRACT(e.value, '$.value') AS entitlement
FROM databricks_workspace.iam.service_principals_v2 sp,
JSON_EACH(sp.entitlements) e
WHERE sp.deployment_name = '{{ deployment_name }}'