Networking

Azure Load Testing: diagnose a private-network engine before exposing the target

A production runbook for separating provisioning, subnet capacity, RBAC, Policy, DNS, NSG, UDR and application failures when a private load test cannot start.

08 Oct 2026 azureload-testingnetworkingvnetdnsnsgudrrbacazure-policyobservabilityautomationrunbookrollbackproduction

An Azure Load Testing run against a private API remains in provisioning, fails before the first sample, or starts without reaching the target. The API works from the application network, so the team proposes exposing it temporarily to the Internet to unblock the campaign.

That workaround removes the exact condition the test is meant to exercise: the application’s real private path. In private traffic mode, Azure Load Testing injects engines into a subnet in the virtual network. The failure can therefore happen before JMeter or Locust runs, at subnet capacity, join permissions, Azure Policy, DNS, routing, or the outbound path used to orchestrate the service.

The running case is an internal API behind a private load balancer. A four-engine test worked the previous week; after network hardening, the run no longer produces client metrics. The objective is to decide whether to repair the subnet, reduce the engine count, restore the private path, roll back the network change, or escalate with an actionable run ID, without making the API public.

Freeze one run and its diagnostic boundary

Preserve one run before editing the network. Record the test and run IDs, UTC time, region, virtual network, subnet, engine count, target hostname, expected resolution mode, and latest known change. Separate three phases: engine provisioning, script startup, and requests to the target.

yaml private-load-test-incident.yml
run:
test_id: private-orders-api
run_id: run-20261008-1740
start_utc: 2026-10-08T17:40:00Z
engine_instances: 4
observed_phase: provisioning

network:
region: francecentral
vnet: vnet-performance-prod
subnet: snet-loadtest
target: api.internal.example
expected_resolution: 10.42.8.12

last_changes:
- subnet route table updated
- outbound NSG deny added
- Azure Policy assignment changed

containment:
expose_target_publicly: forbidden
broad_nsg_allow: forbidden
retry_same_run: only_after_evidence

A provisioning failure with no worker log is not an application failure. An engine that starts and returns UnknownHostException points to DNS. Timeouts after correct resolution move the investigation to NSGs, UDRs, a firewall, or the listener. HTTP responses prove the network carried the request and shift the focus to the script, TLS, authentication, or application.

Verify the injection prerequisites

For this mode, the virtual network and Azure Load Testing resource must be in the same region and subscription. The subnet must be in Succeeded, have no delegation to another service, not use IPv6, and not be a reserved subnet such as AzureFirewallSubnet. Its resource group must not have a lock that prevents injection.

Capacity must be checked against the requested engine count, not just the theoretical CIDR size. Existing interfaces or resources, reserved addresses, and other consumers reduce the addresses actually available. ALTVNET014 is a capacity signal; retrying four engines in the same subnet creates no new address.

bash 01-inventory-load-testing-subnet.sh
RG_NET="rg-network-performance"
VNET="vnet-performance-prod"
SUBNET="snet-loadtest"

az network vnet subnet show \
--resource-group "$RG_NET" \
--vnet-name "$VNET" \
--name "$SUBNET" \
--query '{id:id,prefix:addressPrefix,prefixes:addressPrefixes,state:provisioningState,delegations:delegations[].serviceName,nsg:networkSecurityGroup.id,routeTable:routeTable.id,natGateway:natGateway.id,ipConfigurations:length(ipConfigurations)}' \
--output jsonc

az lock list \
--resource-group "$RG_NET" \
--query '[].{name:name,level:level,scope:scope}' \
--output table

az provider show \
--namespace Microsoft.Batch \
--query registrationState \
--output tsv

Do not remove a delegation, lock, or policy blindly. First prove that it explains the run error, capture its configuration, and bound the change to the test window.

Prove permissions and policy constraints

The operator creating or starting the private test needs permission to join resources to the network; Network Contributor on the virtual network is the usual operational baseline. Verify the effective assignment, scope, and inherited groups. Adding subscription Owner must not become a diagnostic tool.

Azure Policy can allow the test definition to deploy and then block injected resources. Depending on test configuration, the service can create engines, a Load Balancer, an NSG, and a public IP in the subscription for orchestration. A policy denying a resource type, region, SKU, or public IP should be read alongside the deployment error, not disabled globally.

bash 02-check-rbac-and-policy.sh
VNET_ID=$(az network vnet show -g "$RG_NET" -n "$VNET" --query id -o tsv)
OPERATOR_OBJECT_ID="<entra-object-id>"

az role assignment list \
--assignee "$OPERATOR_OBJECT_ID" \
--scope "$VNET_ID" \
--include-inherited \
--query '[].{role:roleDefinitionName,scope:scope,principalType:principalType}' \
--output table

az policy state list \
--resource "$VNET_ID" \
--filter "ComplianceState eq 'NonCompliant'" \
--query '[].{assignment:policyAssignmentName,definition:policyDefinitionName,action:policyDefinitionAction}' \
--output table

If the run exposes ALTVNET004, resolve join permission first. If provisioning names a policy restriction, retain the denied deployment ID and winning definition. A temporary exemption is acceptable only when it targets the test resources and duration, with verified removal afterward.

Separate orchestration egress from target traffic

The engine has two different paths. It must reach Azure services used for orchestration, and it must reach the endpoint under test. A firewall can allow the internal API while blocking engine dependencies; the reverse is also possible.

In a filtered network, verify name resolution and HTTPS to the Azure destinations required by the service, including the *.azure.com, *.windows.net, *.blob.storage.azure.net, and *.azurecr.io families. Plugins included in the plan may add dependencies. Qualify them from a diagnostic point subject to the same DNS, route, and egress controls as the engine subnet.

For the target, test the hostname actually present in the script. Public resolution, a suffix that is not forwarded, or an unlinked private zone creates a different test from the intended one. A Private Endpoint can host the target path, but its existence proves neither the zone link nor the return path.

text load-testing-path-matrix.txt
Provisioning fails, no worker log
Check region, subscription, subnet state and capacity, RBAC, lock, quota, and Policy

Engine starts, hostname does not resolve
Check VNet DNS, forwarding, private zone, VNet link, and the name used in the script

Private hostname is correct, connection times out
Check outbound NSG, UDR, firewall, peering, return route, and target listener

TLS fails
Check SNI, certificate, hostname, TLS inspection, and engine trust store

HTTP 401, 403, 429, or 5xx
The network carried the request; inspect auth, WAF, quotas, test data, and application

One instance fails while others succeed
Compare worker logs, source IP, resolution, data distribution, and local pressure

A NAT Gateway is useful when a public target requires a stable source-IP allowlist. It does not replace a route to a private target and should not be added to hide an unexplained UDR or firewall path.

Read engine logs before changing the load

Download worker logs for every instance and align them to the run timestamp. Find the first error rather than the last cascade: resolution, connection, TLS, script parsing, missing file, plugin, authentication, or application response. Compare engines with each other; a uniform failure suggests a shared dependency, while one failed engine can expose local pressure or an incompletely distributed artifact.

Use debug mode with one engine and a short duration when provisioning succeeds but the script or requests remain ambiguous. Debug mode should produce readable failed requests and responses, not production load. Do not log secrets, tokens, or personal data in the test plan.

Then correlate timestamps at the target: access logs, WAF, Application Insights, or application logs. No request combined with an engine timeout means the failure precedes the application. A 403 emitted by WAF or the API instead proves that broad network access is irrelevant.

Canary the repair and retain a rollback

Restart with one engine, a short duration, one endpoint without business side effects, and a correlation identifier. Validate private resolution, the expected response, and the same identifier in application telemetry. Add engines progressively while checking remaining addresses and path stability.

text private-load-testing-validation-gate.txt
Promote
The canary run provisions one engine without an ALTVNET error
The hostname resolves to the expected address from the engine path
Orchestration dependencies work without a global opening
The target sees the correlation ID and expected source
Worker logs no longer contain the first error
The negative control remains denied

Hold
Available IP capacity is not proven
A policy or lock remains ambiguous
DNS or return traffic follows a path different from the engine subnet

Rollback
Restore the previous NSG, UDR, or DNS forwarding version
Remove the policy exemption and every temporary role
Delete approved diagnostic resources
Retain run ID, error, logs, and before/after evidence

If the repair increases failures, changes the expected source IP, or makes the negative control reachable, stop the canary and restore the last known network state. A load test never justifies leaving a policy exemption, broad role, or Any/Any rule after the window.

Conclusion

An Azure Load Testing engine in a private network is ephemeral, but its path must be as operable as a workload path. Diagnosis starts with the exact run phase, then separates injection, capacity, permissions, policy, orchestration egress, DNS, routing, and application response.

Recovery is proven when a one-engine canary reaches the target by its private hostname, produces correlatable logs, and preserves an expected denial. The team can then scale load gradually, repair one precise control, or roll back the latest network change. Temporarily exposing the target validates none of those decisions.