service_principals_v2
Creates, updates, deletes, gets or lists a service_principals_v2 resource.
Overview
| Name | service_principals_v2 |
| Type | Resource |
| Id | databricks_workspace.iam.service_principals_v2 |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
id | string | Databricks service principal ID. |
active | boolean | |
applicationId | string | UUID relating to the service principal |
displayName | string | String that represents a concatenation of given and family names. |
entitlements | array | Entitlements assigned to the service principal. See [assigning entitlements] for a full list of supported values. [assigning entitlements]: https://docs.databricks.com/administration-guide/users-groups/index.html#assigning-entitlements |
externalId | string | |
groups | array | |
roles | array | Corresponds to AWS instance profile/arn role. |
schemas | array | The schema of the List response. |
| Name | Datatype | Description |
|---|---|---|
id | string | Databricks service principal ID. |
active | boolean | |
applicationId | string | UUID relating to the service principal |
displayName | string | String that represents a concatenation of given and family names. |
entitlements | array | Entitlements assigned to the service principal. See [assigning entitlements] for a full list of supported values. [assigning entitlements]: https://docs.databricks.com/administration-guide/users-groups/index.html#assigning-entitlements |
externalId | string | |
groups | array | |
roles | array | Corresponds to AWS instance profile/arn role. |
schemas | array | The schema of the List response. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | id, deployment_name | Gets the details for a single service principal define in the Databricks workspace. | |
list | select | deployment_name | attributes, count, excluded_attributes, filter, sort_by, sort_order, start_index | Gets the set of service principals associated with a Databricks workspace. |
create | insert | deployment_name | Creates a new service principal in the Databricks workspace. | |
patch | update | id, deployment_name | Partially updates the details of a single service principal in the Databricks workspace. | |
replace | replace | id, deployment_name | Updates the details of a single service principal. | |
delete | delete | id, deployment_name | Delete 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.
| Name | Datatype | Description |
|---|---|---|
deployment_name | string | The Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc) |
id | string | Unique ID for a service principal in the Databricks workspace. |
attributes | string | Comma-separated list of attributes to return in response. |
count | integer | Desired number of results per page. |
excluded_attributes | string | Comma-separated list of attributes to exclude in response. |
filter | string | Query 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] has more details but we currently only support simple expressions. [SCIM RFC]: https://tools.ietf.org/html/rfc7644#section-3.4.2.2 |
sort_by | string | Attribute to sort the results. |
sort_order | string | The order to sort the results. |
start_index | integer | Specifies the index of the first result. First item is number 1. |
SELECT examples
- get
- list
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_v2
WHERE id = '{{ id }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
;
Gets the set of service principals associated with a Databricks workspace.
SELECT
id,
active,
applicationId,
displayName,
entitlements,
externalId,
groups,
roles,
schemas
FROM databricks_workspace.iam.service_principals_v2
WHERE deployment_name = '{{ deployment_name }}' -- required
AND attributes = '{{ attributes }}'
AND count = '{{ count }}'
AND excluded_attributes = '{{ excluded_attributes }}'
AND filter = '{{ filter }}'
AND sort_by = '{{ sort_by }}'
AND sort_order = '{{ sort_order }}'
AND start_index = '{{ start_index }}'
;
INSERT examples
- create
- Manifest
Creates a new service principal in the Databricks workspace.
INSERT INTO databricks_workspace.iam.service_principals_v2 (
active,
application_id,
display_name,
entitlements,
external_id,
groups,
id,
roles,
schemas,
deployment_name
)
SELECT
{{ active }},
'{{ application_id }}',
'{{ display_name }}',
'{{ entitlements }}',
'{{ external_id }}',
'{{ groups }}',
'{{ id }}',
'{{ roles }}',
'{{ schemas }}',
'{{ deployment_name }}'
RETURNING
id,
active,
applicationId,
displayName,
entitlements,
externalId,
groups,
roles,
schemas
;
# Description fields are for documentation purposes
- name: service_principals_v2
props:
- name: deployment_name
value: "{{ deployment_name }}"
description: Required parameter for the service_principals_v2 resource.
- name: active
value: {{ active }}
description: |
If this user is active
- name: application_id
value: "{{ application_id }}"
description: |
UUID relating to the service principal
- name: display_name
value: "{{ display_name }}"
description: |
String that represents a concatenation of given and family names.
- name: entitlements
description: |
Entitlements assigned to the service principal. See [assigning entitlements] for a full list of supported values. [assigning entitlements]: https://docs.databricks.com/administration-guide/users-groups/index.html#assigning-entitlements
value:
- display: "{{ display }}"
primary: {{ primary }}
$ref: "{{ $ref }}"
type: "{{ type }}"
value: "{{ value }}"
- name: external_id
value: "{{ external_id }}"
description: |
:param groups: List[:class:`ComplexValue`] (optional)
- name: groups
value:
- display: "{{ display }}"
primary: {{ primary }}
$ref: "{{ $ref }}"
type: "{{ type }}"
value: "{{ value }}"
- name: id
value: "{{ id }}"
description: |
Databricks service principal ID.
- name: roles
description: |
Corresponds to AWS instance profile/arn role.
value:
- display: "{{ display }}"
primary: {{ primary }}
$ref: "{{ $ref }}"
type: "{{ type }}"
value: "{{ value }}"
- name: schemas
value:
- "{{ schemas }}"
description: |
The schema of the List response.
UPDATE examples
- patch
Partially updates the details of a single service principal in the Databricks workspace.
UPDATE databricks_workspace.iam.service_principals_v2
SET
operations = '{{ operations }}',
schemas = '{{ schemas }}'
WHERE
id = '{{ id }}' --required
AND deployment_name = '{{ deployment_name }}' --required;
REPLACE examples
- replace
Updates the details of a single service principal.
REPLACE databricks_workspace.iam.service_principals_v2
SET
active = {{ active }},
application_id = '{{ application_id }}',
display_name = '{{ display_name }}',
entitlements = '{{ entitlements }}',
external_id = '{{ external_id }}',
groups = '{{ groups }}',
roles = '{{ roles }}',
schemas = '{{ schemas }}'
WHERE
id = '{{ id }}' --required
AND deployment_name = '{{ deployment_name }}' --required;
DELETE examples
- delete
Delete a single service principal in the Databricks workspace.
DELETE FROM databricks_workspace.iam.service_principals_v2
WHERE id = '{{ id }}' --required
AND deployment_name = '{{ deployment_name }}' --required
;