An Azure service that is used to provision Windows and Linux virtual machines.
Resizing can expose or change underlying compute/network behavior, so focus on verifying that SSH is actually listening and reachable from inside the VM, then work outward.
Since Serial Console works, use it (or Run Command) to run these checks and fixes:
- Confirm SSH service is running and listening
In Serial Console:
If it is not active (running), start/restart it:sudo systemctl status sshd.service
Then verify it is listening on the expected port (usually 22):sudo systemctl restart sshd.service
Expected output should show something like:sudo ss --listen --tcp --process --numeric | grep sshd
If nothing is returned, SSH is not listening; reset the SSH configuration (step 3).LISTEN 0 128 0.0.0.0:22 ... LISTEN 0 128 [::]:22 ... - Confirm SSH port configuration
Still in Serial Console, check
/etc/ssh/sshd_config:
If no non-commentgrep -i port /etc/ssh/sshd_config grep -i listen /etc/ssh/sshd_configPortline is present, default is port 22. If a different port is configured, ensure that is the port being used from the client and allowed in NSG. - Reset SSH configuration from Azure side
If SSH is not running or appears misconfigured, reset it to defaults using Azure CLI:
This resets SSH configuration without changing users or keys. If needed, also reset credentials/keys:az vm user reset-ssh --resource-group <yourRG> --name <yourVM>
Alternatively, use the VMAccess extension with aaz vm user update --resource-group <yourRG> --name <yourVM> \ --username <user> --ssh-key-value "$(cat ~/.ssh/id_rsa.pub)"settings.jsoncontaining:
and apply it:{ "reset_ssh": true }az vm extension set --resource-group <yourRG> --vm-name <yourVM> \ --name VMAccessForLinux --publisher Microsoft.OSTCExtensions \ --version 1.2 --settings settings.json - Verify NSG and networking again (post-resize)
After confirming SSH is listening on the VM:
- Ensure the NIC/subnet NSG has an inbound rule allowing TCP 22 from the client IP.
- Confirm there is no higher-priority deny rule blocking it.
- If using a different SSH port, allow that port instead.
- Check that the VM still has the expected public IP and that any upstream firewall allows SSH.
- Check VM health and restart/redeploy if needed
- In the portal, verify Resource health is healthy and boot diagnostics show no boot errors.
- If everything looks healthy but SSH still times out, restart the VM:
- Portal: select the VM → Restart.
- CLI:
az vm restart --resource-group <yourRG> --name <yourVM>
- If the issue persists, redeploy the VM to a new node (noting ephemeral disk data loss and dynamic IP changes) using Redeploy in the portal or:
az vm redeploy --resource-group <yourRG> --name <yourVM>
- Use Run Command if Serial Console is limited
If Serial Console is restricted (for example, key-only auth issues), use Run Command in the Azure portal to run the same
systemctl,ss, andgrepcommands non-interactively and inspect output.
Following this sequence ensures SSH is running and listening inside the VM, correctly configured on the expected port, and reachable through Azure networking after the resize.
References: