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, id, account_hostGets the details for a single service principal define in the Databricks account.
account_service_principals_v2_listselectaccount_id, account_hostattributes, 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_id, account_hostCreates a new service principal in the Databricks account.
account_service_principals_v2_patchupdateaccount_id, id, account_hostPartially updates the details of a single service principal in the Databricks account.
account_service_principals_v2_updatereplaceaccount_id, id, account_hostUpdates the details of a single service principal.
account_service_principals_v2_deletedeleteaccount_id, id, account_hostDelete 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_hoststringThe Databricks account console host. Selected by DATABRICKS_CLOUD (aws, azure or gcp; default aws), or set explicitly with DATABRICKS_ACCOUNT_HOST (bare host, no scheme). (default: accounts.cloud.databricks.com, x-stackQL-envVar: DATABRICKS_ACCOUNT_HOST, x-stackQL-envVarSelector: {"envVar":"DATABRICKS_CLOUD","default":"aws","values":{"aws":"accounts.cloud.databricks.com","azure":"accounts.azuredatabricks.net","gcp":"accounts.gcp.databricks.com"}})
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 <https://tools.ietf.org/html/rfc7644#section-3.4.2.2>__ has more details but we currently only support simple expressions.
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
AND account_host = '{{ account_host }}' -- 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,
account_host
)
SELECT
{{ active }},
'{{ applicationId }}',
'{{ displayName }}',
'{{ externalId }}',
'{{ id }}',
'{{ roles }}',
'{{ account_id }}',
'{{ account_host }}'
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
AND account_host = '{{ account_host }}' --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
AND account_host = '{{ account_host }}' --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
AND account_host = '{{ account_host }}' --required
;