vw_account_service_principal_roles
Creates, updates, deletes, gets or lists a vw_account_service_principal_roles resource.
Overview
| Name | vw_account_service_principal_roles |
| Type | View |
| Id | databricks_account.iam.vw_account_service_principal_roles |
Fields
The following fields are returned by this view:
| Name | Datatype | Description |
|---|---|---|
account_id | string | Databricks account ID 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. |
role | string | Role assigned to the service principal (one row per role assignment). |
Required Parameters
The following parameters are required by this view:
| Name | Datatype | Description |
|---|---|---|
account_id | string | Databricks account ID used to scope the query. |
SELECT Examples
SELECT
account_id,
id,
displayName,
applicationId,
active,
role
FROM databricks_account.iam.vw_account_service_principal_roles
WHERE account_id = '{{ account_id }}';
SQL Definition
- Sqlite3
- Postgres
SELECT
sp.account_id,
sp.id,
sp.displayName,
sp.applicationId,
sp.active,
JSON_EXTRACT(r.value, '$.value') AS role
FROM databricks_account.iam.account_service_principals sp,
JSON_EACH(sp.roles) r
WHERE account_id = '{{ account_id }}'
SELECT
sp.account_id,
sp.id,
sp.displayName,
sp.applicationId,
sp.active,
r.value->>'value' AS role
FROM databricks_account.iam.account_service_principals sp,
jsonb_array_elements(sp.roles::jsonb) AS r
WHERE account_id = '{{ account_id }}'