cli icon indicating copy to clipboard operation
cli copied to clipboard

`databricks secrets` commands unintuitive re: input args - more manpage details needed

Open PaulCornellDB opened this issue 1 year ago • 1 comments

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 example my-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 prompt Please 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.

PaulCornellDB avatar Aug 21 '23 18:08 PaulCornellDB

Please prioritize the enhancement. I spent one hr on this because of bad documentation.

lorabit110 avatar Oct 03 '23 18:10 lorabit110

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.

andrewnester avatar Nov 13 '24 16:11 andrewnester