diff --git a/NEXT_CHANGELOG.md b/NEXT_CHANGELOG.md index 086aff122c7..d25413e32f9 100644 --- a/NEXT_CHANGELOG.md +++ b/NEXT_CHANGELOG.md @@ -7,6 +7,8 @@ ### CLI * Added the `databricks quickstart` command, a short introduction to the CLI that prints a human-friendly guide interactively and an agent-oriented version when run non-interactively ([#5464](https://github.com/databricks/cli/pull/5464)). +* `databricks auth describe` now verifies credentials against both the workspace and account endpoints before reporting a failure, fixing false "Unable to authenticate" errors for account console profiles ([#5479](https://github.com/databricks/cli/issues/5479)). +* `databricks auth login` no longer prompts for workspace selection when logging in to an account console host (`https://accounts.*`). Pass `--workspace-id` explicitly to store a workspace ID on such a profile ([#5504](https://github.com/databricks/cli/pull/5504)). * `databricks auth profiles --skip-validate` no longer makes any network calls; the host metadata fetch is skipped along with validation ([#5530](https://github.com/databricks/cli/pull/5530)). diff --git a/acceptance/cmd/auth/describe/account-host-with-workspace-id/out.test.toml b/acceptance/cmd/auth/describe/account-host-with-workspace-id/out.test.toml new file mode 100644 index 00000000000..f784a183258 --- /dev/null +++ b/acceptance/cmd/auth/describe/account-host-with-workspace-id/out.test.toml @@ -0,0 +1,3 @@ +Local = true +Cloud = false +EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["terraform", "direct"] diff --git a/acceptance/cmd/auth/describe/account-host-with-workspace-id/output.txt b/acceptance/cmd/auth/describe/account-host-with-workspace-id/output.txt new file mode 100644 index 00000000000..0cbc7f6a68c --- /dev/null +++ b/acceptance/cmd/auth/describe/account-host-with-workspace-id/output.txt @@ -0,0 +1,19 @@ + +=== Describe falls back to the account endpoint when the workspace check fails + +>>> [CLI] auth describe --profile acct-with-ws +Host: [DATABRICKS_URL] +Account ID: acct-123 +Authenticated with: pat +----- +Current configuration: + ✓ host: [DATABRICKS_URL] (from DATABRICKS_HOST environment variable) + ✓ account_id: acct-123 (from [TEST_TMP_DIR]/home/.databrickscfg config file) + ✓ workspace_id: [NUMID] (from [TEST_TMP_DIR]/home/.databrickscfg config file) + ✓ token: ******** (from DATABRICKS_TOKEN environment variable) + ✓ profile: acct-with-ws (from --profile flag) + ✓ databricks_cli_path: [CLI] + ✓ auth_type: pat + ✓ rate_limit: [NUMID] (from DATABRICKS_RATE_LIMIT environment variable) + ✓ cloud: AWS + ✓ discovery_url: [DATABRICKS_URL]/oidc/.well-known/oauth-authorization-server diff --git a/acceptance/cmd/auth/describe/account-host-with-workspace-id/script b/acceptance/cmd/auth/describe/account-host-with-workspace-id/script new file mode 100644 index 00000000000..5dec6460178 --- /dev/null +++ b/acceptance/cmd/auth/describe/account-host-with-workspace-id/script @@ -0,0 +1,15 @@ +sethome "./home" + +# Older logins wrote account console profiles with both account_id and +# workspace_id, which resolves to a workspace client even though the host only +# serves account APIs (https://github.com/databricks/cli/issues/5479). +cat > "./home/.databrickscfg" <