Skip to main content

secret_scopes

Creates, updates, deletes, gets or lists a secret_scopes resource.

Overview​

Namesecret_scopes
TypeResource
Iddatabricks_workspace.workspace.secret_scopes

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringA unique name to identify the secret scope.
backend_typestringThe type of secret scope backend. (AZURE_KEYVAULT, DATABRICKS)
â–¶keyvault_metadataobjectThe metadata for the secret scope if the type is ``AZURE_KEYVAULT``

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectdeployment_name, workspace_domainLists all secret scopes available in the workspace.
createinsertdeployment_name, workspace_domain, scopeCreates a new secret scope.
deleteexecdeployment_name, workspace_domain, scopeDeletes a secret scope.

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.

NameDatatypeDescription
deployment_namestringThe Databricks workspace deployment name: the host prefix of the workspace URL (dbc-abcd0123-a1bc on AWS, adb-1234567890123456.7 on Azure, 1234567890123456.7 on GCP). Set DATABRICKS_DEPLOYMENT_NAME to default it for the session. (default: dbc-abcd0123-a1bc, x-stackQL-envVar: DATABRICKS_DEPLOYMENT_NAME)
workspace_domainstringThe Databricks workspace domain suffix for the cloud. Selected by DATABRICKS_CLOUD (aws, azure or gcp; default aws). (default: cloud.databricks.com, x-stackQL-envVarSelector: {"envVar":"DATABRICKS_CLOUD","default":"aws","values":{"aws":"cloud.databricks.com","azure":"azuredatabricks.net","gcp":"gcp.databricks.com"}})

SELECT examples​

Lists all secret scopes available in the workspace.

SELECT
name,
backend_type,
keyvault_metadata
FROM databricks_workspace.workspace.secret_scopes
WHERE deployment_name = '{{ deployment_name }}' -- required
AND workspace_domain = '{{ workspace_domain }}' -- required
;

INSERT examples​

Creates a new secret scope.

INSERT INTO databricks_workspace.workspace.secret_scopes (
scope,
backend_azure_keyvault,
initial_manage_principal,
scope_backend_type,
deployment_name,
workspace_domain
)
SELECT
'{{ scope }}' /* required */,
'{{ backend_azure_keyvault }}',
'{{ initial_manage_principal }}',
'{{ scope_backend_type }}',
'{{ deployment_name }}',
'{{ workspace_domain }}'
;

Lifecycle Methods​

Deletes a secret scope.

EXEC databricks_workspace.workspace.secret_scopes.delete
@deployment_name='{{ deployment_name }}' --required,
@workspace_domain='{{ workspace_domain }}' --required
@@json=
'{
"scope": "{{ scope }}"
}'
;