service_principals
Creates, updates, deletes, gets or lists a service_principals resource.
Overview
| Name | service_principals |
| Type | Resource |
| Id | databricks_workspace.iamv2.service_principals |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
account_id | string | The parent account ID for the service principal in Databricks. |
application_id | string | Application ID of the service principal. |
external_id | string | ExternalId of the service principal in the customer's IdP. |
internal_id | string | Internal service principal ID of the service principal in Databricks. |
display_name | string | Display name of the service principal. |
account_sp_status | string | The activity status of a service principal in a Databricks account. (ACTIVE, INACTIVE) |
| Name | Datatype | Description |
|---|---|---|
account_id | string | The parent account ID for the service principal in Databricks. |
application_id | string | Application ID of the service principal. |
external_id | string | ExternalId of the service principal in the customer's IdP. |
internal_id | string | Internal service principal ID of the service principal in Databricks. |
display_name | string | Display name of the service principal. |
account_sp_status | string | The activity status of a service principal in a Databricks account. (ACTIVE, INACTIVE) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | internal_id, deployment_name | Fetches a service principal by its internal ID from the Databricks account that parents the calling | |
list | select | deployment_name | filter, page_size, page_token | Lists the service principals in the Databricks account that parents the calling workspace, returning |
create | insert | deployment_name, service_principal | Creates a service principal in the Databricks account that parents the calling workspace and returns | |
update | update | internal_id, update_mask, deployment_name, service_principal | Updates an existing service principal in the Databricks account that parents the calling workspace. | |
delete | delete | internal_id, deployment_name | Deletes a service principal by its internal ID from the Databricks account that parents the calling | |
resolve | exec | deployment_name, external_id | Resolves an SP with the given external ID from the customer's IdP. If the SP does not exist, it will |
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.
| Name | Datatype | Description |
|---|---|---|
deployment_name | string | The Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc) |
internal_id | string | Required. Internal ID of the service principal in Databricks. |
update_mask | string | Optional. The list of fields to update. |
filter | string | Optional. Allows filtering service principals by application id or external id. |
page_size | integer | The maximum number of SPs to return. The service may return fewer than this value. |
page_token | string | A page token, received from a previous ListServicePrincipals call. Provide this to retrieve the subsequent page. |
SELECT examples
- get
- list
Fetches a service principal by its internal ID from the Databricks account that parents the calling
SELECT
account_id,
application_id,
external_id,
internal_id,
display_name,
account_sp_status
FROM databricks_workspace.iamv2.service_principals
WHERE internal_id = '{{ internal_id }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
;
Lists the service principals in the Databricks account that parents the calling workspace, returning
SELECT
account_id,
application_id,
external_id,
internal_id,
display_name,
account_sp_status
FROM databricks_workspace.iamv2.service_principals
WHERE deployment_name = '{{ deployment_name }}' -- required
AND filter = '{{ filter }}'
AND page_size = '{{ page_size }}'
AND page_token = '{{ page_token }}'
;
INSERT examples
- create
- Manifest
Creates a service principal in the Databricks account that parents the calling workspace and returns
INSERT INTO databricks_workspace.iamv2.service_principals (
service_principal,
deployment_name
)
SELECT
'{{ service_principal }}' /* required */,
'{{ deployment_name }}'
RETURNING
account_id,
application_id,
external_id,
internal_id,
display_name,
account_sp_status
;
# Description fields are for documentation purposes
- name: service_principals
props:
- name: deployment_name
value: "{{ deployment_name }}"
description: Required parameter for the service_principals resource.
- name: service_principal
description: |
Required. Service principal to be created in <Databricks>
value:
account_id: "{{ account_id }}"
account_sp_status: "{{ account_sp_status }}"
application_id: "{{ application_id }}"
display_name: "{{ display_name }}"
external_id: "{{ external_id }}"
internal_id: "{{ internal_id }}"
UPDATE examples
- update
Updates an existing service principal in the Databricks account that parents the calling workspace.
UPDATE databricks_workspace.iamv2.service_principals
SET
service_principal = '{{ service_principal }}'
WHERE
internal_id = '{{ internal_id }}' --required
AND update_mask = '{{ update_mask }}' --required
AND deployment_name = '{{ deployment_name }}' --required
AND service_principal = '{{ service_principal }}' --required
RETURNING
account_id,
application_id,
external_id,
internal_id,
display_name,
account_sp_status;
DELETE examples
- delete
Deletes a service principal by its internal ID from the Databricks account that parents the calling
DELETE FROM databricks_workspace.iamv2.service_principals
WHERE internal_id = '{{ internal_id }}' --required
AND deployment_name = '{{ deployment_name }}' --required
;
Lifecycle Methods
- resolve
Resolves an SP with the given external ID from the customer's IdP. If the SP does not exist, it will
EXEC databricks_workspace.iamv2.service_principals.resolve
@deployment_name='{{ deployment_name }}' --required
@@json=
'{
"external_id": "{{ external_id }}"
}'
;