Skip to main content

service_principal_secrets

Operations on a service_principal_secrets resource.

Overview

Nameservice_principal_secrets
TypeResource
Iddatabricks_account.oauth.service_principal_secrets

Fields

NameDatatype
idstring
create_timestring
secret_hashstring
statusstring
update_timestring

Methods

NameAccessible byRequired ParamsDescription
listSELECTaccount_id, service_principal_idList all secrets associated with the given service principal. This operation only returns information about the secrets themselves and does not include the secret values.
createINSERTaccount_id, service_principal_idCreate a secret for the given service principal.
deleteDELETEaccount_id, secret_id, service_principal_idDelete a secret from the given service principal.

SELECT examples

SELECT
id,
create_time,
secret_hash,
status,
update_time
FROM databricks_account.oauth.service_principal_secrets
WHERE account_id = '{{ account_id }}' AND
service_principal_id = '{{ service_principal_id }}';

INSERT example

Use the following StackQL query and manifest file to create a new service_principal_secrets resource.

/*+ create */
INSERT INTO databricks_account.oauth.service_principal_secrets (
account_id,
service_principal_id
)
SELECT
'{{ account_id }}',
'{{ service_principal_id }}'
;

DELETE example

Deletes a service_principal_secrets resource.

/*+ delete */
DELETE FROM databricks_account.oauth.service_principal_secrets
WHERE account_id = '{{ account_id }}' AND
secret_id = '{{ secret_id }}' AND
service_principal_id = '{{ service_principal_id }}';