Skip to main content

account_service_principals

Creates, updates, deletes, gets or lists an account_service_principals resource.

Overview

Nameaccount_service_principals
TypeResource
Iddatabricks_account.iam.account_service_principals

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringDatabricks service principal ID.
account_idstring
activebooleanIf this user is active
applicationIdstringUUID relating to the service principal
displayNamestringString that represents a concatenation of given and family names.
externalIdstring
rolesarrayIndicates if the group has the admin role.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
account_service_principals_v2_getselectaccount_id, idGets the details for a single service principal define in the Databricks account.
account_service_principals_v2_listselectaccount_idattributes, count, excluded_attributes, filter, sort_by, sort_order, start_indexGets the set of service principals associated with a Databricks account.
account_service_principals_v2_createinsertaccount_idCreates a new service principal in the Databricks account.
account_service_principals_v2_patchupdateaccount_id, idPartially updates the details of a single service principal in the Databricks account.
account_service_principals_v2_updatereplaceaccount_id, idUpdates the details of a single service principal.
account_service_principals_v2_deletedeleteaccount_id, idDelete a single service principal in the Databricks account.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
account_idstring
idstringUnique ID for a service principal in the Databricks account.
attributesstringComma-separated list of attributes to return in response.
countintegerDesired number of results per page. Default is 10000.
excluded_attributesstringComma-separated list of attributes to exclude in response.
filterstringQuery by which the results have to be filtered. Supported operators are equals(eq), contains(co), starts with(sw) and not equals(ne). Additionally, simple expressions can be formed using logical operators - and and or. The [SCIM RFC] has more details but we currently only support simple expressions. [SCIM RFC]: https://tools.ietf.org/html/rfc7644#section-3.4.2.2
sort_bystringAttribute to sort the results.
sort_orderstringThe order to sort the results.
start_indexintegerSpecifies the index of the first result. First item is number 1.

SELECT examples

Gets the details for a single service principal define in the Databricks account.

SELECT
id,
account_id,
active,
applicationId,
displayName,
externalId,
roles
FROM databricks_account.iam.account_service_principals
WHERE account_id = '{{ account_id }}' -- required
AND id = '{{ id }}' -- required
;

INSERT examples

Creates a new service principal in the Databricks account.

INSERT INTO databricks_account.iam.account_service_principals (
active,
applicationId,
displayName,
externalId,
id,
roles,
account_id
)
SELECT
{{ active }},
'{{ applicationId }}',
'{{ displayName }}',
'{{ externalId }}',
'{{ id }}',
'{{ roles }}',
'{{ account_id }}'
RETURNING
id,
account_id,
active,
applicationId,
displayName,
externalId,
roles
;

UPDATE examples

Partially updates the details of a single service principal in the Databricks account.

UPDATE databricks_account.iam.account_service_principals
SET
Operations = '{{ Operations }}',
schemas = '{{ schemas }}'
WHERE
account_id = '{{ account_id }}' --required
AND id = '{{ id }}' --required;

REPLACE examples

Updates the details of a single service principal.

REPLACE databricks_account.iam.account_service_principals
SET
active = {{ active }},
applicationId = '{{ applicationId }}',
displayName = '{{ displayName }}',
externalId = '{{ externalId }}',
roles = '{{ roles }}'
WHERE
account_id = '{{ account_id }}' --required
AND id = '{{ id }}' --required;

DELETE examples

Delete a single service principal in the Databricks account.

DELETE FROM databricks_account.iam.account_service_principals
WHERE account_id = '{{ account_id }}' --required
AND id = '{{ id }}' --required
;