A VM with a public IP times out on SSH (`ssh: connect to host 20.x.x.x port 22: Connection timed out`).
BeginnerTroubleshootingNetwork Connectivity Errors
Answer
Likely causes → NSG doesn't allow 22 from your IP (Standard public IPs are closed by default), a second NSG on subnet or NIC, guest firewall, or sshd not running.
Diagnose →
az network nic list-effective-nsg -g rg -n vm-app-nic
az network watcher test-ip-flow -g rg --vm vm-app --direction Inbound --protocol TCP \
--local 10.20.1.4:22 --remote <yourIP>:50000
az vm boot-diagnostics get-boot-log -g rg -n vm-app | tail
Fix → Add an allow rule for your IP on port 22 (or use Bastion); check sudo ufw status via Run Command: az vm run-command invoke -g rg -n vm-app --command-id RunShellScript --scripts "systemctl status sshd".
Prevent → No SSH from the internet; Bastion or JIT access.
More on Network Connectivity Errors
`nslookup kv-shop.vault.azure.net` from inside the VNet returns a public IP even though a Private Endpoint exists.IntermediateKey Vault returns `Client address is not authorized and caller is not a trusted service.` (ForbiddenByFirewall).BeginnerApplication Gateway returns `502 Bad Gateway` and backend health shows Unhealthy.IntermediateApp Gateway v2 deployment fails or goes unhealthy after a UDR `0.0.0.0/0 → firewall` was added to its subnet.AdvancedTwo VNets peered but VMs can't communicate; peering state shows `Initiated`.IntermediatePeering creation fails because address spaces overlap.Beginner