Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

databricks auth 'use' command to switch profiles in a shell session #2360

Open
TheRealJimShady opened this issue Feb 19, 2025 · 2 comments
Open
Labels
auth CLI CLI related issues Enhancement New feature or request

Comments

@TheRealJimShady
Copy link

Description
While I'm using the databricks cli from the terminal I often want to make use of the same profile for a period of hours or days, providing the --profile flag for every command isn't a great user experience because I'm likely to forget every so often and accidentally run commands against the wrong profile.

Desired user experience
I would prefer to be able to do something like databricks auth use <profile-name> at the start of my session and run subsequent commands without having to provide the --profile flag. A simple solution could be to have this command set the DATABRICKS_CONFIG_PROFILE environment variable.

@TheRealJimShady TheRealJimShady changed the title Create databricks auth 'use' command to switch profiles in a shell session databricks auth 'use' command to switch profiles in a shell session Feb 19, 2025
@shreyas-goenka
Copy link
Contributor

@TheRealJimShady Thanks for reaching out!

You can configure a DEFAULT profile in your ~/.databrickscfg file. The syntax would look something like:

[DEFAULT]
host = <>
token = <>

Alternatively, you can also set the environment variable yourself, maybe in your .bashrc file. Given that the workarounds exist and are simple enough, having a dedicated command for it does not seem like it's worth the added complexity.

@TheRealJimShady
Copy link
Author

Hi @shreyas-goenka , thanks for your quick response. I think the proposed idea would be a useful improvement for the reasons given but I accept that workarounds exist. It would be a nicer experience for the end user if they could set the working profile at the start of a session, without having to first edit a config file, set an environment variable, or pass in the same parameter for every command. That's just my opinion 🙂

@andrewnester andrewnester added Enhancement New feature or request CLI CLI related issues auth labels Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auth CLI CLI related issues Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants