[Feature] Add option to return error messages as json/text
Databiggs opened this issue · 0 comments
It is currently dfficult to capture errors from the Databricks CLI when running the command from Powershell.
Currently, errors are simply written to the standard output / STDERR which can cause things like Azure Devops CI/CD pipelines to fail when it detects the 'error' keyword in the output thread.
An ideal option would be to add a global flag to allow errors to be returned as either json or text (depending on whether the global flag -o option has been provided). This would allow for errors to be captured within Powershell and dealt with as part of a larger process.
A specific example is where a process calls the following to detect whether to create a new ACL: -
databricks secrets get-acl "scope" "principal@principal.com"
Error: User or Group principal@principal.com does not exist.
Ideally, capturing the above error as json would allow the process to create the missing ACL, rather than having to jump through further hoops (such as using list-acls to get all existing values and then not calling the above command if the principal does not exist)