Skip to main content

scopes

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

Overview

Namescopes
TypeResource
Iddatabricks_workspace.secrets.scopes

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestring
backend_typestring

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listscopesselectdeployment_nameLists all secret scopes available in the workspace.
createscopeinsertdeployment_nameThe scope name must consist of alphanumeric characters, dashes, underscores, and periods, and may not exceed 128 characters.
deletescopedeletedeployment_nameDeletes 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 (default: dbc-abcd0123-a1bc)

SELECT examples

Lists all secret scopes available in the workspace.

SELECT
name,
backend_type
FROM databricks_workspace.secrets.scopes
WHERE deployment_name = '{{ deployment_name }}' -- required;

INSERT examples

The scope name must consist of alphanumeric characters, dashes, underscores, and periods, and may not exceed 128 characters.

INSERT INTO databricks_workspace.secrets.scopes (
data__scope,
data__initial_manage_principal,
data__scope_backend_type,
deployment_name
)
SELECT
'{{ scope }}',
'{{ initial_manage_principal }}',
'{{ scope_backend_type }}',
'{{ deployment_name }}'
;

DELETE examples

Deletes a secret scope.

DELETE FROM databricks_workspace.secrets.scopes
WHERE deployment_name = '{{ deployment_name }}' --required;