service_principals
Operations on a service_principals
resource.
Overview
Name | service_principals |
Type | Resource |
Id | databricks_workspace.iam.service_principals |
Fields
Name | Datatype |
---|---|
id | string |
active | boolean |
applicationId | string |
displayName | string |
entitlements | array |
externalId | string |
groups | array |
roles | array |
schemas | array |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | id, deployment_name | Gets the details for a single service principal define in the Databricks workspace. |
list | SELECT | deployment_name | Gets the set of service principals associated with a Databricks workspace. |
create | INSERT | deployment_name | Creates a new service principal in the Databricks workspace. |
delete | DELETE | id, deployment_name | Delete a single service principal in the Databricks workspace. |
patch | UPDATE | id, deployment_name | Partially updates the details of a single service principal in the Databricks workspace. |
update | UPDATE | id, deployment_name | Updates the details of a single service principal. |
SELECT
examples
- service_principals (list)
- service_principals (get)
SELECT
id,
active,
applicationId,
displayName,
entitlements,
externalId,
groups,
roles,
schemas
FROM databricks_workspace.iam.service_principals
WHERE deployment_name = '{{ deployment_name }}';
SELECT
id,
active,
applicationId,
displayName,
entitlements,
externalId,
groups,
roles,
schemas
FROM databricks_workspace.iam.service_principals
WHERE id = '{{ id }}' AND
deployment_name = '{{ deployment_name }}';
INSERT
example
Use the following StackQL query and manifest file to create a new service_principals
resource.
- service_principals
- Manifest
/*+ 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 }}'
;
- name: your_resource_model_name
props:
- name: schemas
value:
- urn:ietf:params:scim:schemas:core:2.0:ServicePrincipal
- name: applicationId
value: 97ab27fa-30e2-43e3-92a3-160e80f4c0d5
- name: displayName
value: etl-service
- name: groups
value:
- $ref: string
value: string
display: string
primary: true
type: string
- name: roles
value:
- $ref: string
value: string
display: string
primary: true
type: string
- name: entitlements
value:
- $ref: string
value: string
display: string
primary: true
type: string
- name: externalId
value: string
- name: active
value: true
UPDATE
example
Updates a service_principals
resource.
- patch
- update
/*+ 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 }}';
/*+ 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 }}';