vw_service_principal_entitlements
Creates, updates, deletes, gets or lists a vw_service_principal_entitlements resource.
Overview
| Name | vw_service_principal_entitlements |
| Type | View |
| Id | databricks_workspace.iam.vw_service_principal_entitlements |
Fields
The following fields are returned by this view:
| Name | Datatype | Description |
|---|---|---|
deployment_name | string | Workspace deployment name used to scope the query. |
id | string | Unique identifier for the service principal. |
displayName | string | Human-readable display name of the service principal. |
applicationId | integer | Application ID of the service principal. |
active | boolean | Whether the service principal is active. |
entitlement | string | Entitlement 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:
| Name | Datatype | Description |
|---|---|---|
deployment_name | string | Workspace 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
- Sqlite3
- Postgres
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 }}'
SELECT
sp.deployment_name,
sp.id,
sp.displayName,
sp.applicationId,
sp.active,
e.value->>'value' AS entitlement
FROM databricks_workspace.iam.service_principals_v2 sp,
jsonb_array_elements(sp.entitlements::jsonb) AS e
WHERE sp.deployment_name = '{{ deployment_name }}'