databricks auth 'use' command to switch profiles in a shell session
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 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.
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 🙂
This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.