Q: A pipeline works on a Microsoft-hosted agent but fails with a connection timeout on a self-hosted agent. How would you isolate the issue?
Network and proxy isolation framework for diagnosing connection timeouts on self-hosted Azure DevOps agents operating inside corporate VNets.
Want to master this scenario in a live sandbox? KodeKloud's Enterprise GitOps with ArgoCD & Kubernetes Rollouts covers this exact problem with hands-on terminal drills.
🛠️ Production Runbook & Step-by-Step Resolution
Direct Answer: Microsoft-hosted agents have open outbound internet access, while self-hosted agents live inside restricted Azure VNets with corporate Network Security Groups (NSGs), route tables, and outbound proxies. The issue is almost always VNet routing, firewall egress, or proxy configuration.
Verify Outbound Network Security Group (NSG) Rules
Check if the subnet hosting the self-hosted VM has an NSG rule blocking outbound port 443 to the target service (e.g., GitHub, Azure Artifacts, Docker Hub, or Azure Resource Manager).
# Test connectivity directly from the self-hosted agent shell
nc -zv dev.azure.com 443
curl -Iv https://pkg.actions.githubusercontent.com
Check Corporate Proxy & Environment Variables
If your organization routes traffic through an egress proxy (e.g., Squid, Zscaler), ensure HTTP_PROXY, HTTPS_PROXY, and NO_PROXY are defined in the agent's .env file and that TLS inspection certificates are installed.
Validate Azure Private DNS Zone Resolution
If accessing internal resources like Azure Container Registry (ACR) with Private Endpoints, verify the self-hosted agent VM resolves the private IP address rather than the public IP.
nslookup myacr.azurecr.io
# Expected: 10.x.x.x private IP, NOT public 20.x.x.x
- Test outbound connectivity from the agent VM using curl -Iv and nc -zv on port 443.
- Verify Network Security Groups (NSGs) and Azure Firewall egress filtering rules.
- Inspect HTTP_PROXY, HTTPS_PROXY, and corporate CA certificate trust in the agent .env file.
- Confirm Private DNS zone resolution for internal ACR and Key Vault private endpoints.
Senior hiring managers and bar raisers evaluate how you prioritize during outages. Avoid these common anti-patterns:
- Promoting application releases to production without an automated, canary-validated rollback mechanism when configuring Azure Pipeline Succeeds Pipelines that lack automated rollback mechanisms force engineering teams to scramble manual hotfixes during severe production regressions.
- Running concurrent deployment pipeline jobs without stage mutex locking on shared target environments when configuring Azure Pipeline Succeeds Concurrent pipeline runs on the same environment race to apply state changes, causing out-of-order commits and unpredictable deployment state.
- Omitting dependency lockfiles (package-lock.json, go.sum, Cargo.lock) from continuous integration builds when configuring Azure Pipeline Succeeds Omitting lockfiles allows upstream package updates to break builds unpredictably without any changes to application codebase.
- Failing to define dynamic cache invalidation keys for CI package managers and layer caches when configuring Azure Pipeline Succeeds Stale build caches mask underlying dependency incompatibilities or pull outdated libraries, while un-cached runs slow feedback loops.