cli
cli copied to clipboard
`databricks secrets` commands unintuitive re: input args - more manpage details needed
Repro steps:
Run the command databricks secrets put-secret <scope-name> <scope-key> --json @./<file-name>.json
-
Replace
<scope-name>
with some new or existing secrets scope name, for examplemy-scope
. -
Replace
<file-name>
with a file that contains the secret key and secret, for example:{"string_value": "foo"}
Expected:
Secret is created.
Actual:
Error: accepts 0 arg(s), received 2
Remediation:
To make the error go away, you must do this instead:
-
Option 1:
databricks secrets put-secret <scope-name> <scope-key>
, and then respond to the on-screen promptPlease enter your secret value
. -
Option 2:
databricks secrets put-secret --json @./<file-name>.json
, with a file that contains the scope name, scope key, and secret, for example:{ "scope": "<scope-name>", "key": "<scope-key>", "type": "string_value", "string_value": "foo" }
Requested fix:
As the remediation options do not seem intuitive, either a) more text to help guide the user should be added to the related manpage, or b) the CLI should be fixed to make the call more intuitive.
Also, not sure what other databricks secrets
commands this issue applies to. They should probably all be evaluated similarly.
Please prioritize the enhancement. I spent one hr on this because of bad documentation.
There were multiple improvements to CLI commands including better error messages and warning on incorrect JSON payload. Now this command works more intuitively and provides a better guidance if something goes wrong.