Skip to main content

service_principals

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

Overview

Nameservice_principals
TypeResource
Iddatabricks_workspace.iam.service_principals

Fields

The following fields are returned by SELECT queries:

Service principal information was returned successfully.

NameDatatypeDescription
idstring
activeboolean
applicationIdstring
displayNamestring
entitlementsarray
externalIdstring
groupsarray
rolesarray
schemasarray

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectdeployment_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.
updateupdatedeployment_nameUpdates the details of a single service principal.
patchupdatedeployment_namePartially updates the details of a single service principal in the Databricks workspace.
deletedeletedeployment_nameDelete a single service principal in the Databricks workspace.

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
deployment_namestringThe Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc)

SELECT examples

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

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

INSERT examples

Creates a new service principal in the Databricks workspace.

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

UPDATE examples

Updates the details of a single service principal.

UPDATE databricks_workspace.iam.service_principals
SET
data__schemas = '{{ schemas }}',
data__id = {{ id }},
data__applicationId = '{{ applicationId }}',
data__displayName = '{{ displayName }}',
data__externalId = '{{ externalId }}',
data__active = {{ active }},
data__groups = '{{ groups }}',
data__roles = '{{ roles }}',
data__entitlements = '{{ entitlements }}'
WHERE
deployment_name = '{{ deployment_name }}' --required;

DELETE examples

Delete a single service principal in the Databricks workspace.

DELETE FROM databricks_workspace.iam.service_principals
WHERE deployment_name = '{{ deployment_name }}' --required;