`Connection refused` when an App Service app calls an API on a VM in a peered VNet over port 8080.
BeginnerTroubleshootingNetwork Connectivity Errors
Answer
Likely causes → Refused (not timeout) means the packet reached the host and nothing listens: wrong port, app bound to 127.0.0.1, service down.
Diagnose → On the VM: ss -tlnp | grep 8080.
Fix → Bind the app to 0.0.0.0:8080, start the service, correct the port.
Prevent → Readiness checks and documented ports.
More on Network Connectivity Errors
A VM with a public IP times out on SSH (`ssh: connect to host 20.x.x.x port 22: Connection timed out`).Beginner`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`.Intermediate