auth: suggest ACCOUNT-<id> as default profile name for --skip-workspace#5339
Merged
Conversation
When `databricks auth login --host X --skip-workspace` runs, the profile- name prompt suggested the host's first DNS label (e.g. `db-deco-test`) even though the resulting profile is account-only. The naming logic in `getProfileName` already returns `ACCOUNT-<account-id>` when `AccountID` is populated, but `setHostAndAccountId` (which discovers `account_id` via `.well-known/databricks-config`) only runs *after* the profile-name prompt, so `AccountID` was still empty at suggestion time. For the `--skip-workspace` path with a known host, run URL-param extraction and host discovery eagerly before the prompt fires. Other login paths are unchanged. Co-authored-by: Isaac
Collaborator
|
Commit: 22e4516 |
mihaimitrea-db
approved these changes
May 27, 2026
Collaborator
|
Commit: b999e77 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
When you run `databricks auth login --host X --skip-workspace`, the profile-name prompt suggests the host's first DNS label (e.g. `db-deco-test`) even though the resulting profile is account-only.
Changes
`getProfileName` already returns `ACCOUNT-` when `AccountID` is populated, but `setHostAndAccountId` (which fills `AccountID` from `.well-known/databricks-config`) only runs after the profile-name prompt. So at prompt time, `AccountID` was always empty for the no-`--profile` flow.
Other login paths are unchanged. The discovery call is redundant with the one in `setHostAndAccountId` later in the flow; `runHostDiscovery` is idempotent for the auth-arguments fields it touches, so the cost is at most one extra `.well-known` round-trip (≤5s timeout) and only on the `--skip-workspace` path.
Test plan