Azure / cli

Automate your GitHub workflows using Azure CLI scripts
MIT License
124 stars 52 forks source link

az ssh command doesn't work due to OpenSSH not being installed in the docker container #146

Closed Gilthans closed 2 months ago

Gilthans commented 3 months ago

Trying to use az ssh vm with this action does not work, and fails with:

WARNING: The command requires the extension ssh. It will be installed first.
WARNING: Default enabled including preview versions for extension installation now. Disabled in May 2024. Use '--allow-preview true' to enable it specifically if needed. Use '--allow-preview false' to install stable version only. 
ERROR: Failed to run ssh command with error: [Errno 2] No such file or directory: 'ssh'.

Attempting to install OpenSSH inside the inline script didn't seem to resolve the issue. Is there a way to get this working?

MoChilia commented 2 months ago

Hi @Gilthans, have you added the ssh extension with az extension add --name ssh before trying az ssh vm?

Gilthans commented 2 months ago

I did not, but the tool was trying to install the extension automatically which is when it failed

MoChilia commented 2 months ago

@Gilthans, according to https://github.com/Azure/azure-cli/issues/27841#issuecomment-1809942182, azure-cli has removed ssh from the docker image since 2.54.0, you have to install it manually. If you have already installed OpenSSH but the error persists, you can try using the argument --ssh-client-folder to provide the OpenSSH folder path.

MoChilia commented 2 months ago

Closing the issue for now. If you have any further questions, feel free to reopen it.