az ssh exit code always 0, even if subcommand fails #6831
Labels
Auto-Assign
Auto assign by bot
customer-reported
Issues that are reported by GitHub users external to the Azure organization.
question
The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Service Attention
This issue is responsible by Azure service team.
VM SSH
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
The text was updated successfully, but these errors were encountered: