Skip to content

[ISSUE] Removing tags from databricks_sql_endpoint fails #5051

@hytonla1

Description

@hytonla1

Configuration

We have a SQL Endpoint with the following definition:

resource "databricks_sql_endpoint" "this" {
  name                      = "tag_test"
  cluster_size              = "2X-Small"
  auto_stop_mins            = 5
  enable_photon             = false
  enable_serverless_compute = true
  warehouse_type            = "PRO"
  tags {
    custom_tags {
      key   = "tagKey"
      value = "tagValue"
    }
  }
}

This configuration has been applied.

We are trying apply an update to the resource where we have removed the tag configuration:

resource "databricks_sql_endpoint" "this" {
  name                      = "tag_test"
  cluster_size              = "2X-Small"
  auto_stop_mins            = 5
  enable_photon             = false
  enable_serverless_compute = true
  warehouse_type            = "PRO"
}

Expected Behavior

The tags should have been removed from the SQL Endpoint.

Actual Behavior

We get the following terraform plan:

Terraform will perform the following actions:

  # databricks_sql_endpoint.this will be updated in-place
  ~ resource "databricks_sql_endpoint" "this" {
        id                        = "8b6dd3c95e54e7c8"
        name                      = "tag_test"
        # (16 unchanged attributes hidden)

      ~ tags {
          ~ custom_tags {
              - key   = "tagKey" -> null
              - value = "tagValue" -> null
            }
        }
    }

Plan: 0 to add, 1 to change, 0 to destroy.

However, running apply results in the following error:

│ Error: cannot update sql endpoint:
│ Invalid tag key () - the minimal length is 1, and the
│ maximum length is 512.
│
│
│   with databricks_sql_endpoint.this,
│   on sql_warehouses.tf line 32, in resource "databricks_sql_endpoint" "this":
│   32: resource "databricks_sql_endpoint" "this" {
│

Steps to Reproduce

  1. Create a SQL Endpoint with tags
  2. Run terraform apply
  3. Remove tags from the SQL Endpoint configuration
  4. Run terraform apply

Terraform and provider versions

terraform --version
Terraform v1.13.3
on linux_amd64
+ provider registry.terraform.io/databricks/databricks v1.90.0

Is it a regression?

Can't say for sure, this is the first time we have tried removing tags from our endpoints.

Debug Output

Terrraform debug logs show an empty tag configration is indeed sent to the API:

2025-09-23T15:57:23.544+0300 [DEBUG] provider.terraform-provider-databricks_v1.90.0: POST /api/2.0/sql/warehouses/8b6dd3c95e54e7c8/edit
> {
>   "auto_stop_mins": 5,
>   "cluster_size": "2X-Small",
>   "creator_name": "**REDACTED**",
>   "enable_photon": false,
>   "enable_serverless_compute": true,
>   "max_num_clusters": 1,
>   "min_num_clusters": 1,
>   "name": "tag_test",
>   "spot_instance_policy": "COST_OPTIMIZED",
>   "tags": {
>     "custom_tags": [
>       {}
>     ]
>   },
>   "warehouse_type": "PRO"
> }
< HTTP/2.0 400 Bad Request
< {
<   "details": [
<     {
<       "@type": "type.googleapis.com/google.rpc.RequestInfo",
<       "request_id": "bf4f1c43-1022-4015-a0a7-1a10366cde34",
<       "serving_data": ""
<     }
<   ],
<   "error_code": "INVALID_PARAMETER_VALUE",
<   "message": "\nInvalid tag key () - the minimal length is 1, and the\nmaximum length is 512.\n     "
< }: @module=databricks tf_mux_provider=tf5to6server.v5tov6Server tf_provider_addr=registry.terraform.io/databricks/databricks tf_req_id=a8adbc90-c902-57e2-5a64-db3a20e79362 tf_rpc=ConfigureProvider @caller=/home/runner/work/terraform-provider-databricks/terraform-provider-databricks/logger/logger.go:38 timestamp="2025-09-23T15:57:23.544+0300"

Important Factoids

This occurs in Azure Databricks.

Would you like to implement a fix?

Not this time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions