databricks-cli icon indicating copy to clipboard operation
databricks-cli copied to clipboard

Add environment variable for default profile

Open rbu opened this issue 5 years ago • 4 comments

To use databricks in several projects from my development machine, I'm using profiles. However, it would be helpful if I could set an environment to change the profile that is chosen by default so I can more easily reuse commands (between prod and dev).

Example use:

$ databricks workspace ls --profile databricks-cloud-dev
Users
Shared
^^ existing behaviour

$ DATABRICKS_PROFILE="databricks-cloud-dev" databricks workspace ls 
Users
Shared
^^ desired behaviour

NB: aws cli supports this via the AWS_PROFILE variable

rbu avatar Aug 18 '20 07:08 rbu

There appears to be an env var listed for precisely this purpose (link); however, this does not appear to work as of v0.16.2

DATABRICKS_CONFIG_PROFILE

cbcoutinho avatar Dec 04 '21 14:12 cbcoutinho

@cbcoutinho Looks like they realized the mistake, as the reference to this string is gone from the page now.

image

Ref https://web.archive.org/web/20211121054306/https://docs.microsoft.com/en-us/azure/databricks/dev-tools/cli/

rbu avatar Dec 14 '21 13:12 rbu

That's a shame, now there's a discrepancy between how the databricks cli and tf provider read config files - one accepts a profile and the other requires the default profile with host and token.

At least now the docs are up to date

Op di 14 dec. 2021 14:16 schreef @.***>:

@cbcoutinho https://github.com/cbcoutinho Looks like they realized the mistake, as the reference to this string is gone from the page now.

[image: image] https://user-images.githubusercontent.com/65913/146005346-0395e5c3-4b69-44f3-ac21-6f2191808a4d.png

Ref https://web.archive.org/web/20211121054306/https://docs.microsoft.com/en-us/azure/databricks/dev-tools/cli/

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/databricks/databricks-cli/issues/315#issuecomment-993529223, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADCN33GCXCQWUQUGVAOQSP3UQ47UBANCNFSM4QDABLEA .

cbcoutinho avatar Dec 16 '21 08:12 cbcoutinho

Yes, we'll eventually introduce DATABRICKS_CONF_PROFILE env var for this

nfx avatar May 04 '22 17:05 nfx