I am trying to get the exit code as 0 or 1 from az vm run-command.
az vm run-command invoke -g myRG -n myVM --command-id RunShellScript --scripts "/home/azureuser/cassandra-script.sh" -o json | grep nodetool
but either my script succeeds or fails it gives the "$?" as 0. so decided to put " | grep xxxxx " but with this, it gives an error
`Error: Error: az cli script failed. cleaning up container... MICROSOFT_AZURE_CLI_1654967445460_CONTAINER
(node:1679) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag
--unhandled-rejections=strict(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)`
however, when I try to run the same command from azure cloud cli it works fine. but I want to use it in the GitHub actions pipeline Please help