---
title: secrets-uc command group
description: Learn how to use the Databricks CLI secrets-uc commands
canonical_url: https://docs.databricks.com/gcp/en/dev-tools/cli/reference/secrets-uc-commands
---

# `secrets-uc` command group

> [!NOTE]
>
> Databricks CLI use is subject to the [Databricks License](https://github.com/databricks/cli?tab=License-1-ov-file#readme) and [Databricks Privacy Notice](https://www.databricks.com/legal/privacynotice), including any Usage Data provisions.

> [!NOTE]
> **Preview**
>
> This feature is in [Public Preview](https://docs.databricks.com/gcp/en/release-notes/release-types.md).

The `secrets-uc` command group within the [Databricks CLI](https://docs.databricks.com/gcp/en/dev-tools/cli/index.md) manages Unity Catalog secrets. A secret is a Unity Catalog securable object that stores sensitive credential data (such as passwords, tokens, and keys) within a three-level namespace (`catalog_name.schema_name.secret_name`). Secrets can be managed using standard Unity Catalog permissions and are scoped to a schema within a catalog.

## databricks secrets-uc create-secret

Creates a new secret in Unity Catalog. You must be the owner of the parent schema or have the **CREATE\_SECRET** and **USE SCHEMA** privileges on the parent schema and **USE CATALOG** on the parent catalog. The secret is stored in the specified catalog and schema, and the **value** field contains the sensitive data to be securely stored.

```
databricks secrets-uc create-secret NAME CATALOG_NAME SCHEMA_NAME VALUE [flags]
```

#### Arguments

**`NAME`**

    The name of the secret, relative to its parent schema.

**`CATALOG_NAME`**

    The name of the catalog where the schema and the secret reside.

**`SCHEMA_NAME`**

    The name of the schema where the secret resides.

**`VALUE`**

    The 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.

#### Options

**`--comment string`**

    User-provided free-form text description of the secret.

**`--expire-time string`**

    User-provided expiration time of the secret.

**`--json JSON`**

    The inline JSON string or the @path to the JSON file with the request body.

**`--owner string`**

    The owner of the secret.

[Global flags](https://docs.databricks.com/gcp/en/dev-tools/cli/reference/secrets-uc-commands.md#global-flags)

## databricks secrets-uc delete-secret

Deletes a secret by its three-level (fully qualified) name. You must be the owner of the secret or a metastore admin.

```
databricks secrets-uc delete-secret FULL_NAME [flags]
```

#### Arguments

**`FULL_NAME`**

    The three-level (fully qualified) name of the secret (for example, **catalog\_name.schema\_name.secret\_name**).

#### Options

[Global flags](https://docs.databricks.com/gcp/en/dev-tools/cli/reference/secrets-uc-commands.md#global-flags)

## databricks secrets-uc get-secret

Gets a secret by its three-level (fully qualified) name. You must be a metastore admin, the owner of the secret, or have the **MANAGE** privilege on the secret. The secret value isn't returned by default. To retrieve it, you must also have the **READ\_SECRET** privilege and set **include\_value** to true in the request.

```
databricks secrets-uc get-secret FULL_NAME [flags]
```

#### Arguments

**`FULL_NAME`**

    The three-level (fully qualified) name of the secret (for example, **catalog\_name.schema\_name.secret\_name**).

#### Options

[Global flags](https://docs.databricks.com/gcp/en/dev-tools/cli/reference/secrets-uc-commands.md#global-flags)

## databricks secrets-uc list-secrets

Lists secrets in Unity Catalog. You must be a metastore admin, the owner of the secret, or have the **MANAGE** privilege on the secret. Both **catalog\_name** and **schema\_name** must be specified together to filter secrets within a specific schema. Results are paginated; use the **page\_token** field from the response to retrieve subsequent pages.

```
databricks secrets-uc list-secrets [flags]
```

#### Options

**`--catalog-name string`**

    The name of the catalog under which to list secrets.

**`--limit int`**

    Maximum number of results to return.

**`--page-size int`**

    Maximum number of secrets to return.

**`--schema-name string`**

    The name of the schema under which to list secrets.

[Global flags](https://docs.databricks.com/gcp/en/dev-tools/cli/reference/secrets-uc-commands.md#global-flags)

## databricks secrets-uc update-secret

Updates an existing secret in Unity Catalog. You must be the owner of the secret or a metastore admin. If you are a metastore admin, only the **owner** field can be changed. Use the **update\_mask** field to specify which fields to update. Supported updatable fields include **value**, **comment**, **owner**, and **expire\_time**.

```
databricks secrets-uc update-secret FULL_NAME UPDATE_MASK NAME CATALOG_NAME SCHEMA_NAME VALUE [flags]
```

#### Arguments

**`FULL_NAME`**

    The three-level (fully qualified) name of the secret (for example, **catalog\_name.schema\_name.secret\_name**).

**`UPDATE_MASK`**

    The 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.

**`NAME`**

    The name of the secret, relative to its parent schema.

**`CATALOG_NAME`**

    The name of the catalog where the schema and the secret reside.

**`SCHEMA_NAME`**

    The name of the schema where the secret resides.

**`VALUE`**

    The 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.

#### Options

**`--comment string`**

    User-provided free-form text description of the secret.

**`--expire-time string`**

    User-provided expiration time of the secret.

**`--json JSON`**

    The inline JSON string or the @path to the JSON file with the request body.

**`--owner string`**

    The owner of the secret.

[Global flags](https://docs.databricks.com/gcp/en/dev-tools/cli/reference/secrets-uc-commands.md#global-flags)

## <a id="global-flags" />Global flags

**`--debug`**

  Whether to enable debug logging.

**`-h` or `--help`**

    Display help for the Databricks CLI or the related command group or the related command.

**`--log-file` string**

    A string representing the file to write output logs to. If this flag is not specified then the default is to write output logs to stderr.

**`--log-format` format**

    The log format type, `text` or `json`. The default value is `text`.

**`--log-level` string**

    A string representing the log format level. If not specified then the log format level is disabled.

**`-o, --output` type**

    The command output type, `text` or `json`. The default value is `text`.

**`-p, --profile` string**

    The name of the profile in the `~/.databrickscfg` file to use to run the command. If this flag is not specified then if it exists, the profile named `DEFAULT` is used.

**`--progress-format` format**

    The format to display progress logs: `default`, `append`, `inplace`, or `json`

**`-t, --target` string**

    If applicable, the bundle target to use
