service_principals
Operations on a service_principals
resource.
Overview
Name | service_principals |
Type | Resource |
Id | databricks_account.iam.service_principals |
Fields
Name | Datatype |
---|---|
id | string |
active | boolean |
applicationId | string |
displayName | string |
externalId | string |
roles | array |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | account_id, id | Gets the details for a single service principal define in the Databricks account. |
list | SELECT | account_id | Gets the set of service principals associated with a Databricks account. |
create | INSERT | account_id | Creates a new service principal in the Databricks account. |
delete | DELETE | account_id, id | Delete a single service principal in the Databricks account. |
patch | UPDATE | account_id, id | Partially updates the details of a single service principal in the Databricks account. |
update | REPLACE | account_id, id | Updates the details of a single service principal. |
SELECT
examples
- service_principals (list)
- service_principals (get)
SELECT
id,
active,
applicationId,
displayName,
externalId,
roles
FROM databricks_account.iam.service_principals
WHERE account_id = '{{ account_id }}';
SELECT
id,
active,
applicationId,
displayName,
externalId,
roles
FROM databricks_account.iam.service_principals
WHERE account_id = '{{ account_id }}' AND
id = '{{ id }}';
INSERT
example
Use the following StackQL query and manifest file to create a new service_principals
resource.
- service_principals
- Manifest
/*+ create */
INSERT INTO databricks_account.iam.service_principals (
account_id,
data__applicationId,
data__displayName,
data__roles,
data__externalId,
data__active
)
SELECT
'{{ account_id }}',
'{{ applicationId }}',
'{{ displayName }}',
'{{ roles }}',
'{{ externalId }}',
'{{ active }}'
;
- name: your_resource_model_name
props:
- name: applicationId
value: 97ab27fa-30e2-43e3-92a3-160e80f4c0d5
- name: displayName
value: etl-service
- name: roles
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.
/*+ update */
-- replace field1, field2, etc. with the fields you want to update
UPDATE databricks_account.iam.service_principals
SET field1 = '{{ value1 }}',
field2 = '{{ value2 }}', ...
WHERE account_id = '{{ account_id }}' AND
id = '{{ id }}';
REPLACE
example
Replaces a service_principals
resource.
/*+ update */
-- replace field1, field2, etc. with the fields you want to update
REPLACE databricks_account.iam.service_principals
SET field1 = '{ value1 }',
field2 = '{ value2 }', ...
WHERE account_id = '{{ account_id }}' AND
id = '{{ id }}';
DELETE
example
Deletes a service_principals
resource.
/*+ delete */
DELETE FROM databricks_account.iam.service_principals
WHERE account_id = '{{ account_id }}' AND
id = '{{ id }}';