databricks-cli/cmd
Miles Yucht 9a0888126c
Improve auth login experience (#570)
## Changes
Currently, `databricks auth login` is difficult to use. If a user types
this command in, the command fails with
```
Error: init: cannot fetch credentials
```
after prompting for a profile name.

To make this experience smoother, this change ensures that the host, and
if necessary, the account ID, are prompted for input from the user if
they aren't provided on the CLI.


## Tests
Manual tests:

```
$ ./cli auth token                   
Databricks Host: https://<HOST>.staging.cloud.databricks.com
{
  "access_token": "...",
  "token_type": "Bearer",
  "expiry": "2023-07-11T12:56:59.929671+02:00"
}
$ ./cli auth login
Databricks Host: https://<HOST>.staging.cloud.databricks.com
Databricks Profile Name: <HOST>-test
Profile <HOST>-test was successfully saved
$ ./cli auth login
Databricks Host: https://accounts.cloud.databricks.com
Databricks Account ID: <ACCOUNTID>
Databricks Profile Name: ACCOUNT-<ACCOUNTID>-test
Profile ACCOUNT-<ACCOUNTID>-test was successfully saved 
```

---------

Co-authored-by: Pieter Noordhuis <pieter.noordhuis@databricks.com>
2023-07-12 15:36:09 +00:00
..
account Fixed ignoring required positional parameters when --json flag is provided (#535) 2023-07-03 13:20:30 +02:00
api Rename bricks -> databricks (#389) 2023-05-16 18:35:39 +02:00
auth Improve auth login experience (#570) 2023-07-12 15:36:09 +00:00
bundle Add development runs (#522) 2023-07-12 08:51:54 +02:00
configure Update configure command (#482) 2023-06-15 12:50:19 +00:00
fs Update cp help message to not require file scheme (#554) 2023-07-06 13:16:14 +02:00
root Correctly use --profile flag passed for all bundle commands (#571) 2023-07-12 14:09:25 +02:00
sync Remove \r from new line print statments (#509) 2023-06-22 13:47:52 +02:00
version Use cmdio in version command for `--output` flag (#419) 2023-06-01 12:03:22 +02:00
workspace Fix secrets put-secret command (#545) 2023-07-05 17:30:54 +02:00