Skip to main content

vw_account_service_principal_roles

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

Overview​

Namevw_account_service_principal_roles
TypeView
Iddatabricks_account.iam.vw_account_service_principal_roles

Fields​

The following fields are returned by this view:

NameDatatypeDescription
account_idstringDatabricks account ID 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.
rolestringRole assigned to the service principal (one row per role assignment).

Required Parameters​

The following parameters are required by this view:

NameDatatypeDescription
account_idstringDatabricks 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​

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 }}'