yggdrasil.databricks.cli.services.configure¶
configure ¶
ygg databricks configure — set up a Databricks profile, the way
databricks configure does, then remember it as the current session.
Three things in one command:
- Write a profile into
~/.databrickscfg(the same INI file the Databricks CLI / SDK read). Host + token are taken from flags, or prompted for interactively (token hidden) when omitted — mirroringdatabricks configure --token. Existing profiles in the file are preserved; only the named section is rewritten. - Verify the credentials by building a :class:
DatabricksClientagainst the freshly written profile and resolving the current user (skippable with--no-verify). With--ssothis runs the interactive browser / CLI flow. - Remember the session — the verified client becomes the process
current client (:meth:
DatabricksClient.set_current) and a small metadata snapshot of the latest session (profile, host, user, workspace/account ids, timestamp) is dumped into the session folder~/.config/databricks-sdk-py/sessions/as<hostname>.json(the per-machine default) so later tooling can default to "the workspace I last configured on this host". For an SSO login the credential is not on disk, so the resolved session bearer token is captured into the snapshot too (and the file is locked to owner-only).
Sub-actions::
ygg databricks configure # write + verify + remember
ygg databricks configure --profile prod --host https://… --token dapi…
ygg databricks configure --sso --host https://… # SSO: dump the token
ygg databricks configure list # list profiles in ~/.databrickscfg
ygg databricks configure session # show the remembered session