Skip to main content

service_principals

Operations on a service_principals resource.

Overview

Nameservice_principals
TypeResource
Iddatabricks_workspace.iam.service_principals

Fields

NameDatatype
idstring
activeboolean
applicationIdstring
displayNamestring
entitlementsarray
externalIdstring
groupsarray
rolesarray
schemasarray

Methods

NameAccessible byRequired ParamsDescription
getSELECTid, deployment_nameGets the details for a single service principal define in the Databricks workspace.
listSELECTdeployment_nameGets the set of service principals associated with a Databricks workspace.
createINSERTdeployment_nameCreates a new service principal in the Databricks workspace.
deleteDELETEid, deployment_nameDelete a single service principal in the Databricks workspace.
patchUPDATEid, deployment_namePartially updates the details of a single service principal in the Databricks workspace.
updateUPDATEid, deployment_nameUpdates the details of a single service principal.

SELECT examples

SELECT
id,
active,
applicationId,
displayName,
entitlements,
externalId,
groups,
roles,
schemas
FROM databricks_workspace.iam.service_principals
WHERE deployment_name = '{{ deployment_name }}';

INSERT example

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

/*+ create */
INSERT INTO databricks_workspace.iam.service_principals (
deployment_name,
data__schemas,
data__applicationId,
data__displayName,
data__groups,
data__roles,
data__entitlements,
data__externalId,
data__active
)
SELECT
'{{ deployment_name }}',
'{{ schemas }}',
'{{ applicationId }}',
'{{ displayName }}',
'{{ groups }}',
'{{ roles }}',
'{{ entitlements }}',
'{{ externalId }}',
'{{ active }}'
;

UPDATE example

Updates a service_principals resource.

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

DELETE example

Deletes a service_principals resource.

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