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

# `workspace-entity-tag-assignments` 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.

The `workspace-entity-tag-assignments` command group within the [Databricks CLI](https://docs.databricks.com/gcp/en/dev-tools/cli/index.md) contains commands to manage tag assignments on workspace-scoped objects.

## databricks workspace-entity-tag-assignments create-tag-assignment

Create a tag assignment for a workspace-scoped object.

```
databricks workspace-entity-tag-assignments create-tag-assignment ENTITY_TYPE ENTITY_ID TAG_KEY [flags]
```

#### Arguments

**`ENTITY_TYPE`**

    The type of entity to which the tag is assigned. Allowed values are: `dashboards`, `geniespaces`.

**`ENTITY_ID`**

    The identifier of the entity to which the tag is assigned.

**`TAG_KEY`**

    The key of the tag. The characters `,` `.` `:` `/` `-` `=` and leading/trailing spaces are not allowed.

#### Options

**`--json JSON`**

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

**`--tag-value string`**

    The value of the tag.

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

#### Examples

The following example creates a tag assignment for a dashboard:

```bash
databricks workspace-entity-tag-assignments create-tag-assignment dashboards abc123def456 environment --tag-value production
```

The following example creates a tag assignment for a Genie Agent:

```bash
databricks workspace-entity-tag-assignments create-tag-assignment geniespaces xyz789 department --tag-value engineering
```

The following example creates a tag assignment using JSON:

```bash
databricks workspace-entity-tag-assignments create-tag-assignment dashboards abc123def456 project --json '{"tag_value": "analytics"}'
```

## databricks workspace-entity-tag-assignments delete-tag-assignment

Delete a tag assignment from a workspace-scoped object.

```
databricks workspace-entity-tag-assignments delete-tag-assignment ENTITY_TYPE ENTITY_ID TAG_KEY [flags]
```

#### Arguments

**`ENTITY_TYPE`**

    The type of entity to which the tag is assigned. Allowed values are: `dashboards`, `geniespaces`.

**`ENTITY_ID`**

    The identifier of the entity to which the tag is assigned.

**`TAG_KEY`**

    The key of the tag. The characters `,` `.` `:` `/` `-` `=` and leading/trailing spaces are not allowed.

#### Options

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

#### Examples

The following example deletes a tag assignment from a dashboard:

```bash
databricks workspace-entity-tag-assignments delete-tag-assignment dashboards abc123def456 environment
```

The following example deletes a tag assignment from a Genie Agent:

```bash
databricks workspace-entity-tag-assignments delete-tag-assignment geniespaces xyz789 department
```

## databricks workspace-entity-tag-assignments get-tag-assignment

Retrieves a tag assignment for a workspace-scoped object.

```
databricks workspace-entity-tag-assignments get-tag-assignment ENTITY_TYPE ENTITY_ID TAG_KEY [flags]
```

#### Arguments

**`ENTITY_TYPE`**

    The type of entity to which the tag is assigned. Allowed values are: `dashboards`, `geniespaces`.

**`ENTITY_ID`**

    The identifier of the entity to which the tag is assigned.

**`TAG_KEY`**

    The key of the tag. The characters `,` `.` `:` `/` `-` `=` and leading/trailing spaces are not allowed.

#### Options

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

#### Examples

The following example gets a tag assignment for a dashboard:

```bash
databricks workspace-entity-tag-assignments get-tag-assignment dashboards abc123def456 environment
```

The following example gets a tag assignment for a Genie Agent:

```bash
databricks workspace-entity-tag-assignments get-tag-assignment geniespaces xyz789 department
```

## databricks workspace-entity-tag-assignments list-tag-assignments

List all tag assignments for a workspace-scoped object.

```
databricks workspace-entity-tag-assignments list-tag-assignments ENTITY_TYPE ENTITY_ID [flags]
```

#### Arguments

**`ENTITY_TYPE`**

    The type of entity to which the tag is assigned. Allowed values are: `dashboards`, `geniespaces`.

**`ENTITY_ID`**

    The identifier of the entity to which the tag is assigned.

#### Options

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

    Maximum number of tag assignments to return per page.

**`--page-token string`**

    Token to retrieve the next page of results.

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

#### Examples

The following example lists all tag assignments for a dashboard:

```bash
databricks workspace-entity-tag-assignments list-tag-assignments dashboards abc123def456
```

The following example lists tag assignments with pagination:

```bash
databricks workspace-entity-tag-assignments list-tag-assignments dashboards abc123def456 --page-size 10
```

## databricks workspace-entity-tag-assignments update-tag-assignment

Update a tag assignment for a workspace-scoped object.

```
databricks workspace-entity-tag-assignments update-tag-assignment ENTITY_TYPE ENTITY_ID TAG_KEY UPDATE_MASK [flags]
```

#### Arguments

**`ENTITY_TYPE`**

    The type of entity to which the tag is assigned. Allowed values are: `dashboards`, `geniespaces`.

**`ENTITY_ID`**

    The identifier of the entity to which the tag is assigned.

**`TAG_KEY`**

    The key of the tag. The characters `,` `.` `:` `/` `-` `=` and leading/trailing spaces are not allowed.

**`UPDATE_MASK`**

    The field mask must be a single string, with multiple fields separated by commas (no spaces). The field path is relative to the resource object, using a dot (`.`) to navigate sub-fields (e.g., `author.given_name`). Specification of elements in sequence or map fields is not allowed, as only the entire collection field can be specified. Field names must exactly match the resource field names.

    An asterisk (`*`) field mask indicates full replacement. It's recommended to always explicitly list the fields being updated and avoid using wildcards, as it can lead to unintended results if the API changes in the future.

#### Options

**`--json JSON`**

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

**`--tag-value string`**

    The value of the tag.

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

#### Examples

The following example updates a tag assignment for a dashboard:

```bash
databricks workspace-entity-tag-assignments update-tag-assignment dashboards abc123def456 environment "tag_value" --tag-value staging
```

The following example updates a tag assignment using JSON:

```bash
databricks workspace-entity-tag-assignments update-tag-assignment geniespaces xyz789 department "tag_value" --json '{"tag_value": "sales"}'
```

## <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
