Skip to main content

secrets_uc

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

Overview

Namesecrets_uc
TypeResource
Iddatabricks_workspace.catalog.secrets_uc

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringThe name of the secret, relative to its parent schema.
metastore_idstringUnique identifier of the metastore hosting the secret.
catalog_namestringThe name of the catalog where the schema and the secret reside.
full_namestringThe three-level (fully qualified) name of the secret, in the form of **catalog_name.schema_name.secret_name**.
schema_namestringThe name of the schema where the secret resides.
commentstringUser-provided free-form text description of the secret.
create_timestring (date-time)The time at which this secret was created.
created_bystringThe principal that created the secret.
effective_ownerstringThe effective owner of the secret, which may differ from the directly-set **owner** due to inheritance.
effective_valuestringThe secret value. Only populated in responses when you have the **READ_SECRET** privilege and **include_value** is set to true in the request. The maximum size is 60 KiB.
expire_timestring (date-time)User-provided expiration time of the secret. This field indicates when the secret should no longer be used and may be displayed as a warning in the UI. It is purely informational and does not trigger any automatic actions or affect the secret's lifecycle.
ownerstringThe owner of the secret. Defaults to the creating principal on creation. Can be updated to transfer ownership of the secret to another principal.
update_timestring (date-time)The time at which this secret was last updated.
updated_bystringThe principal that last updated the secret.
valuestringThe secret value to store. This field is input-only and is not returned in responses — use the **effective_value** field (via GetSecret with **include_value** set to true) to read the secret value. The maximum size is 60 KiB (pre-encryption). Accepted content includes passwords, tokens, keys, and other sensitive credential data.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
secrets_uc_get_secretselectfull_name, deployment_nameGets a secret by its three-level (fully qualified) name.
secrets_uc_list_secretsselectdeployment_namecatalog_name, page_size, page_token, schema_nameLists secrets in Unity Catalog.
secrets_uc_create_secretinsertdeployment_name, secretCreates a new secret in Unity Catalog.
secrets_uc_update_secretupdatefull_name, update_mask, deployment_name, secretUpdates an existing secret in Unity Catalog.
secrets_uc_delete_secretdeletefull_name, deployment_nameDeletes a secret by its three-level (fully qualified) name.

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)
full_namestringThe three-level (fully qualified) name of the secret (for example, catalog_name.schema_name.secret_name).
update_maskobjectThe field mask specifying which fields of the secret to update. - If update_mask is "*", all fields specified in secret are updated. - If update_mask specifies one or more fields, only those fields are updated. Each specified field must be set in secret. Supported fields: value, comment, owner, expire_time. To change the secret name, delete and recreate the secret.
catalog_namestringThe name of the catalog under which to list secrets. Both catalog_name and schema_name must be specified together.
page_sizeintegerMaximum number of secrets to return. - If not specified, at most 1000 secrets are returned. - If set to a value greater than 0, the page length is the minimum of this value and 1000. - If set to 0, the page length is set to 1000. - If set to a value less than 0, an invalid parameter error is returned.
page_tokenstringOpaque pagination token to go to the next page based on previous query. The maximum page length is determined by a server configured value.
schema_namestringThe name of the schema under which to list secrets. Both catalog_name and schema_name must be specified together.

SELECT examples

Gets a secret by its three-level (fully qualified) name.

SELECT
name,
metastore_id,
catalog_name,
full_name,
schema_name,
comment,
create_time,
created_by,
effective_owner,
effective_value,
expire_time,
owner,
update_time,
updated_by,
value
FROM databricks_workspace.catalog.secrets_uc
WHERE full_name = '{{ full_name }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
;

INSERT examples

Creates a new secret in Unity Catalog.

INSERT INTO databricks_workspace.catalog.secrets_uc (
secret,
deployment_name
)
SELECT
'{{ secret }}' /* required */,
'{{ deployment_name }}'
RETURNING
name,
metastore_id,
catalog_name,
full_name,
schema_name,
comment,
create_time,
created_by,
effective_owner,
effective_value,
expire_time,
owner,
update_time,
updated_by,
value
;

UPDATE examples

Updates an existing secret in Unity Catalog.

UPDATE databricks_workspace.catalog.secrets_uc
SET
secret = '{{ secret }}'
WHERE
full_name = '{{ full_name }}' --required
AND update_mask = '{{ update_mask }}' --required
AND deployment_name = '{{ deployment_name }}' --required
AND secret = '{{ secret }}' --required
RETURNING
name,
metastore_id,
catalog_name,
full_name,
schema_name,
comment,
create_time,
created_by,
effective_owner,
effective_value,
expire_time,
owner,
update_time,
updated_by,
value;

DELETE examples

Deletes a secret by its three-level (fully qualified) name.

DELETE FROM databricks_workspace.catalog.secrets_uc
WHERE full_name = '{{ full_name }}' --required
AND deployment_name = '{{ deployment_name }}' --required
;