Skip to content

CLI profile not respected #5096

@peter-ocelka

Description

@peter-ocelka

Describe the issue

I have setup 3 profiles in ~/.databickscfg, all with different URLs and different PATs. No profile was set as default.

  • When I am in bundle directory and I run for example databricks jobs list --profile tst-svc (test profile) the result is listed from dev environment
  • When I am in the $HOME and I run the same, I get the results from test environment.

I have two env variables set via direnv tool on the repository:
DATABRICKS_TOKEN and DATABRICKS_HOST - pointing to DEV

Steps to reproduce the behavior

n/a

Expected Behavior

If profile is specified in CLI command, it should override env variables.

Actual Behavior

--profile is ignored when env variables are present.

OS and CLI version

  • WSL2 - Ubuntu
  • 0.298.0

Is this a regression?

I don't know.

Debug Logs

15:50:41 Info: start pid=63698 version=0.298.0 args="databricks, jobs, list, --debug, --profile, tst-svc"
15:50:41 Debug: Loading tst-svc profile from /home/pocelka/.databrickscfg pid=63698 sdk=true
15:50:41 Debug: [Local Cache] using cache key: [redacted] pid=63698
15:50:41 Debug: [Local Cache] cache hit pid=63698
15:50:41 Debug: Resolved account_id from host metadata: "[redacted]" pid=63698 sdk=true
15:50:41 Debug: Resolved workspace_id from host metadata: "[redacted - but gets ID from DEV]" pid=63698 sdk=true
15:50:41 Debug: Resolved cloud from hostname: "AWS" pid=63698 sdk=true
15:50:41 Debug: Resolved token_audience from host metadata token_federation_default_oidc_audiences: "[redacted - but dev URL]" pid=63698 sdk=true
15:50:41 Debug: Resolved discovery_url from host metadata: "[redacted - dev url]" pid=63698 sdk=true
15:50:42 Debug: GET /api/2.2/jobs/list

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLICLI related issuesauth

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions