An Azure service that is used to provision Windows and Linux virtual machines.
Hello Marco,
Thank you for sharing the detailed information.
Based on the behavior observed after resizing the VM to the Standard D4s_v5 SKU, the issue appears to be related to the Linux operating system not completing the boot process successfully. Since both SSH access and the Azure Linux VM Agent became unavailable immediately after the resize operation, this usually indicates that critical services are failing during startup or the VM has entered emergency mode.
The “Connection refused” error suggests that the VM is still reachable over the network, but the SSH service itself is not running or the OS boot sequence is incomplete. In similar scenarios, this can occur due to network interface remapping after the resize, invalid mount entries in /etc/fstab, filesystem-related startup failures, or issues with the Azure Linux VM Agent during boot.
As a first step, we recommend enabling and reviewing Boot Diagnostics from the Azure portal under: VM → Support + Troubleshooting → Boot diagnostics
Please check the console screenshot and serial logs for any filesystem errors, emergency mode messages, mount failures, or kernel-related errors.
Documentation: https://learn.microsoft.com/en-us/troubleshoot/azure/virtual-machines/windows/boot-diagnostics?
We also recommend accessing the VM through Azure Serial Console to verify the current boot state and collect additional logs. Once connected, please review the status of the SSH service, Azure Linux Agent, network interfaces, and filesystem configuration using the following commands:
systemctl status sshd
systemctl status walinuxagent
journalctl -xb
ip addr
cat /etc/fstab
blkid
Documentation: https://learn.microsoft.com/en-us/troubleshoot/azure/virtual-machines/linux/serial-console-linux
If the VM still remains inaccessible, you may also try performing a VM Redeploy operation, which moves the VM to a new Azure host while preserving the OS disk and configuration.
Documentation: https://learn.microsoft.com/en-us/troubleshoot/azure/virtual-machines/linux/redeploy-to-new-node-linux?
In case the issue persists, the recommended recovery approach would be to use the Azure VM Repair workflow to attach the OS disk to a temporary repair VM and correct the configuration offline.
Documentation: Repair a Linux VM using Azure VM Repair commands
Additionally, the following troubleshooting guidance may also help:
Troubleshoot Linux VM boot issues
Hope this helps! Please let me know if you have any queries.