Open pwandl opened 1 year ago
Thank you for opening this issue, we will look into it.
Any updates on this?
Facing the same problem when building a script executing this command that I expected to get an exit code from if the az ssh arc...
command fails to connect to the Arc machine.
Would love to see this getting fixed. I believe it would be expected behavior to propagate the exit code from the ssh command to az cli
Describe the bug
When using
az ssh vm
, the exit code is always 0, even if ssh command itself failed. When using openssh, the exit code of the ssh process returns the exit code of the executed command, but when usingaz ssh
, the exit code is ignored, which makes it hard to determined whether the command was executed successfully.Related command
az ssh vm
Errors
No actual error, but exit code is wrongly set to 0
Issue script & Debug output
az ssh vm --debug -n some-vm -g some-group "exit 1"
Expected behavior
The exit code should match the exit code of the subcommand, similar when using ssh like this:
Environment Summary
azure-cli 2.51.0 *
core 2.51.0 * telemetry 1.1.0
Extensions: containerapp 0.3.37 front-door 1.0.17 interactive 0.5.3 ssh 2.0.1
Dependencies: msal 1.24.0b1 azure-mgmt-resource 23.1.0b2
Additional context
No response