Skip to main content

service_principals

Operations on a service_principals resource.

Overview

Nameservice_principals
TypeResource
Iddatabricks_account.iam.service_principals

Fields

NameDatatype
idstring
activeboolean
applicationIdstring
displayNamestring
externalIdstring
rolesarray

Methods

NameAccessible byRequired ParamsDescription
getSELECTaccount_id, idGets the details for a single service principal define in the Databricks account.
listSELECTaccount_idGets the set of service principals associated with a Databricks account.
createINSERTaccount_idCreates a new service principal in the Databricks account.
deleteDELETEaccount_id, idDelete a single service principal in the Databricks account.
patchUPDATEaccount_id, idPartially updates the details of a single service principal in the Databricks account.
updateREPLACEaccount_id, idUpdates the details of a single service principal.

SELECT examples

SELECT
id,
active,
applicationId,
displayName,
externalId,
roles
FROM databricks_account.iam.service_principals
WHERE account_id = '{{ account_id }}';

INSERT example

Use the following StackQL query and manifest file to create a new service_principals resource.

/*+ create */
INSERT INTO databricks_account.iam.service_principals (
account_id,
data__applicationId,
data__displayName,
data__roles,
data__externalId,
data__active
)
SELECT
'{{ account_id }}',
'{{ applicationId }}',
'{{ displayName }}',
'{{ roles }}',
'{{ externalId }}',
'{{ active }}'
;

UPDATE example

Updates a service_principals resource.

/*+ update */
-- replace field1, field2, etc. with the fields you want to update
UPDATE databricks_account.iam.service_principals
SET field1 = '{{ value1 }}',
field2 = '{{ value2 }}', ...
WHERE account_id = '{{ account_id }}' AND
id = '{{ id }}';

REPLACE example

Replaces a service_principals resource.

/*+ update */
-- replace field1, field2, etc. with the fields you want to update
REPLACE databricks_account.iam.service_principals
SET field1 = '{ value1 }',
field2 = '{ value2 }', ...
WHERE account_id = '{{ account_id }}' AND
id = '{{ id }}';

DELETE example

Deletes a service_principals resource.

/*+ delete */
DELETE FROM databricks_account.iam.service_principals
WHERE account_id = '{{ account_id }}' AND
id = '{{ id }}';