An Azure service that is used to provision Windows and Linux virtual machines.
Hi Will,
The Network Watcher test doesn't change anything on the VM or the NSG. Connection troubleshoot is agentless now and only sends test probes, so things working right after you run it is very likely timing, not cause. That leaves two usual suspects.
1. How the VM gets out to the internet. If the VM has no public IP, NAT gateway or load balancer outbound rule, it's using default outbound access. That IP belongs to Microsoft and can change without notice, so if the provider allowlists your source IP, connections will work some of the time and fail the rest. Check which IP you leave from when it works and when it fails:
Invoke-RestMethod https://api.ipify.org
2. Idle connections being dropped. If the service keeps one long-lived TLS connection open and it goes quiet, the outbound flow is removed after 4 minutes idle. The app still thinks it's connected, but packets go nowhere until it reconnects. TCP keepalives shorter than 4 minutes, or an app-level heartbeat, fix this.
To tell them apart, run this and note when it starts failing:
while ($true) {
"{0} {1}" -f (Get-Date -Format T), (Test-NetConnection provider.example.com -Port 443 -WarningAction SilentlyContinue).TcpTestSucceeded
Start-Sleep 30
}
If new connections fail too, check Effective routes on the NIC. A 0.0.0.0/0 route to a firewall or NVA means that device is the one dropping traffic.
Either way, the clean fix is an explicit outbound method: a NAT gateway on the subnet, or a Standard public IP on the VM. You get a static outbound IP to give the provider, and default outbound access is being retired anyway.
References:
- Default outbound access: https://learn.microsoft.com/en-us/azure/virtual-network/ip-services/default-outbound-access
- Idle timeout and keepalives: https://learn.microsoft.com/en-us/troubleshoot/azure/nat-gateway/troubleshoot-nat-connectivity
- Connection troubleshoot: https://learn.microsoft.com/en-us/azure/network-watcher/connection-troubleshoot-overview