On unified Databricks hosts that serve multiple workspaces, the CLI sends a
routing header so the gateway can dispatch each request to the correct
workspace. The platform is consolidating workspace addressing onto a single
header name. Switch the header sent on workspace-scoped API calls from
X-Databricks-Org-Id to X-Databricks-Workspace-Id. The previous header
continues to be accepted by the platform, so older CLI versions keep working.
This change covers the hand-written paths in the CLI that issue workspace-
routed API calls without going through generated SDK service methods:
- databricks api {verb} (cmd/api/api.go)
- Files API filer (libs/filer/files_client.go)
- Workspace files filer (libs/filer/workspace_files_client.go)
- Telemetry uploads (libs/telemetry/logger.go)
The value continues to come from the workspace_id config field or
DATABRICKS_WORKSPACE_ID.
The CurrentWorkspaceID() helper in the SDK still reads X-Databricks-Org-Id
from the response on /api/2.0/preview/scim/v2/Me, so the response-side
references in libs/testserver/handlers.go and libs/testproxy/server.go
intentionally remain on the legacy header name.
Summary
On unified Databricks hosts that serve multiple workspaces, the CLI sends a routing header so the gateway can dispatch each request to the correct workspace. The platform is consolidating workspace addressing onto a single header name. This PR switches the header sent on workspace-scoped API calls from
X-Databricks-Org-IdtoX-Databricks-Workspace-Id. The previous header continues to be accepted by the platform, so older CLI versions keep working.The value continues to come from the
workspace_idconfig field orDATABRICKS_WORKSPACE_IDenvironment variable.Scope
Hand-written CLI paths that issue workspace-routed API calls without going through generated SDK service methods:
databricks api {verb}(cmd/api/api.go)libs/filer/files_client.go)libs/filer/workspace_files_client.go)libs/telemetry/logger.go)The matching change inside the SDK landed in databricks/databricks-sdk-go#1688 and will reach generated service methods on the next SDK bump.
Asymmetric migration
Only the request-side header flips. The SDK's
CurrentWorkspaceID()still readsX-Databricks-Org-Idfrom the response on/api/2.0/preview/scim/v2/Me, because the server continues to echo the legacy response header. The two CLI test fakes that support that flow stay on the legacy name intentionally:libs/testserver/handlers.go—/Memock response headerlibs/testproxy/server.go—includeResponseHeadersfor the proxyTest plan
go test ./cmd/api/... ./libs/filer/... ./libs/telemetry/...— greengo test ./acceptance -run 'TestAccept/cmd/api|TestAccept/telemetry/(failure|timeout|partial)'— green (acceptance fixtures regenerated via-update)./task lint-q— 0 issues;./task fmt— no changesgit grep -in 'X-Databricks-Org' -- ':!*.md' ':!*.sum' ':!bundle/'— only the two intentional response-side fakes plus a context comment incmd/api/api.go