Networking

Azure App Service: diagnose DNS resolution after VNet Integration before adding a workaround

A production runbook for identifying the resolver App Service actually uses, separating DNS answers from connectivity, validating a canary and restoring the previous configuration.

09 Nov 2026 azureapp-servicevnet-integrationdnsprivate-dnsnetworkingobservabilityautomationrunbookrollbackproduction

An App Service application integrated with a VNet stops reaching an internal API after a DNS change. A VM in the same network returns the expected address. The application times out during resolution, receives NXDOMAIN, or keeps an old address. A static mapping, public resolver, or series of restarts may restore one request, but it removes evidence without repairing the resolution path.

The running case is a Linux or Windows application calling orders.internal.example. The dependency might be a private API, an internal zone, or an Azure service exposed through a private endpoint; the private endpoint is only one possible destination, not the diagnostic frame. The objective is to identify the resolver each worker actually uses, prove the DNS answer and TCP path separately, then make an explicit decision: repair forwarding, correct the App Service override, promote the change, or restore the previous DNS configuration.

Freeze the contract before changing DNS

Preserve the application, VNet and zone configuration before flushing a cache or adding an alternate server. An answer observed from Cloud Shell does not necessarily represent the answer seen by App Service.

yaml 01-app-service-dns-incident.yml
incident: INC-DNS-APP-219
app: api-checkout-prod
slot: production
dependency: orders.internal.example
expected_answer: 10.42.8.14
first_failure_utc: 2026-11-09T14:12:00Z
last_known_good_utc: 2026-11-09T13:55:00Z
vnet_integration_subnet: /subscriptions/.../subnets/snet-app-integration
recent_changes:
- vnet_dns_servers
- dns_forwarding_ruleset_or_link
- app_dnsConfiguration
- WEBSITE_DNS_SERVER_or_ALT_SERVER
- private_zone_record_or_link
preserve:
- app and slot DNS properties
- VNet DNS server list
- zone record, TTL and link state
- resolver health and forwarding rule version
- answers observed from app workers and control VM
rollback_target: dns-contract-2026-11-08

Also record the exact FQDN used by the code, port, error class and UTC window. Resolution failure, TCP refusal and TLS failure do not have the same owner or fix.

Reconstruct the effective resolver chain

With VNet Integration, App Service normally inherits the VNet DNS configuration. An application can still declare its own servers in properties.dnsConfiguration.dnsServers. Those site properties take precedence over legacy app settings such as WEBSITE_DNS_SERVER; WEBSITE_DNS_ALT_SERVER appends a server to the list. Inventory all three levels instead of assuming the VNet is the only authority.

bash 02-export-dns-contract.sh
RG="rg-app-prod"
APP="api-checkout-prod"
VNET_RG="rg-network-prod"
VNET="vnet-app-prod"

az resource show \
--resource-group "$RG" \
--name "$APP" \
--resource-type Microsoft.Web/sites \
--query "{subnet:properties.virtualNetworkSubnetId,dns:properties.dnsConfiguration}" \
--output json > app-dns-properties.json

az webapp config appsettings list \
--resource-group "$RG" --name "$APP" \
--query "[?starts_with(name, 'WEBSITE_DNS_') || name=='WEBSITE_ENABLE_DNS_CACHE'].{name:name,value:value}" \
--output json > app-dns-settings.json

az network vnet show \
--resource-group "$VNET_RG" --name "$VNET" \
--query "{id:id,dnsServers:dhcpOptions.dnsServers}" \
--output json > vnet-dns.json

Do not attach the complete app-settings export to the incident: it can contain secrets. Retain only the required DNS keys, configuration source and resource identifiers.

Make the expected chain explicit:

text 03-resolution-chain.txt
App Service worker
-> site dnsConfiguration, when set
-> otherwise DNS servers inherited from the VNet
-> optional WEBSITE_DNS_ALT_SERVER appended
-> resolver or DNS proxy reachable from integration subnet
-> forwarding rule matching the suffix
-> authoritative zone or Azure DNS
-> expected A/CNAME record and TTL

When the VNet uses custom servers, they must also resolve the public names the application consumes. Adding Azure DNS as a fallback without understanding evaluation order can produce different answers depending on which resolver responds in time.

Test from the worker, not an administration host

First confirm that VNet Integration is effective on the worker by checking WEBSITE_PRIVATE_IP in the Kudu environment. Then test resolution from the same execution environment as the application.

For a native Windows application, use nameresolver.exe; nslookup does not represent the expected App Service DNS path. On Linux, use nslookup with the default resolver and then with each server explicitly.

text 04-worker-tests.txt
NATIVE WINDOWS - Kudu console
nameresolver.exe orders.internal.example
nameresolver.exe orders.internal.example 10.20.0.4
tcpping.exe orders.internal.example 443

LINUX - Kudu/SSH console
nslookup orders.internal.example
nslookup orders.internal.example 10.20.0.4
curl -sv --connect-timeout 5 https://orders.internal.example/health

Testing each resolver directly separates three failure classes:

  • the resolver does not respond from the integration subnet: inspect NSGs, firewall, routing and health for UDP 53, then TCP 53 where the client supports it; Windows App Service does not perform DNS resolution over TCP;
  • the resolver responds with the wrong answer: inspect forwarding, zone links, CNAMEs, records and cache state;
  • the answer is correct but the request fails: move to TCP, TLS and dependency authorization.

Test one critical public name and one deliberately nonexistent name as well. The first detects an internal resolver that cannot recurse for public dependencies. The second proves that the chain returns a bounded failure instead of a search-domain address or an unexpected synthetic answer.

Compare the application with a meaningful control

A control VM is useful only when it follows the same DNS path. Record its VNet, configured servers and answer from each resolver. A VM querying Azure DNS directly is not a control for an application going through a DNS proxy.

text 05-dns-evidence-matrix.txt
SOURCE             RESOLVER       ANSWER          LATENCY   PORT 53   TCP 443
App worker A       inherited       10.42.8.14      18 ms     yes       yes
App worker B       inherited       timeout         >3 s      no        n/a
App worker A       10.20.0.4       10.42.8.14      12 ms     yes       yes
VM in same VNet    10.20.0.4       10.42.8.14       7 ms     yes       yes
Resolver           authoritative   10.42.8.14       2 ms     n/a       n/a

Additional controls
- critical public name: expected answer on every resolver
- nonexistent name: consistent NXDOMAIN
- complete CNAME: identical chain to target
- TTL and timestamp: compatible with the change window

A worker-to-worker divergence points to incomplete propagation, cache state or different network paths. Correlate repeated bounded application probes with WEBSITE_INSTANCE_ID; do not conclude from one successful Kudu session.

Repair the first broken boundary

Apply the correction where the defect is owned.

  • If the site override is stale, restore dnsConfiguration from the approved state instead of layering another app setting.
  • If the VNet names the wrong resolver, correct its server list only after inventorying every consumer.
  • If the resolver is unreachable, repair the narrowest network path to its addresses on UDP 53 and, where the client supports it, TCP 53.
  • If forwarding is missing, add a rule for the exact suffix and validate its target.
  • If the zone or link is wrong, repair the record or link without opening public access to the dependency.
  • If only cache state is involved, wait for TTL expiry or recycle a controlled canary; do not turn a cache operation into a permanent configuration fix.

Changing retry count, timeout or maximum cache duration can alter the symptom, but it cannot repair an unreachable server or a false authoritative answer. Treat these settings as a measured resilience policy, not an emergency value.

Canary the fix and keep rollback ready

Apply the change to a slot or canary application that shares the same network design. Run the matrix from multiple instances, then validate the application call with an identity and payload that cannot create side effects.

text 06-app-service-dns-gate.txt
PROMOTE WHEN
- every worker uses the approved resolver list
- the private FQDN returns the expected answer within the latency budget
- critical public names still resolve
- the negative control returns the expected failure
- TCP, TLS and the application probe succeed as separate checks
- DNS timeout and dependency latency do not regress

ROLL BACK WHEN
- workers still disagree
- a resolver returns an old view or wrong CNAME
- the fix expands resolution or network scope beyond the contract
- the canary loses a public dependency
- the application can no longer distinguish DNS and application errors

Rollback restores the site DNS properties, relevant app settings, VNet DNS list, and forwarding or zone version that formed the last healthy contract. Repeat positive and negative probes after restoration. A restart can refresh a worker, but it must not replace configuration rollback.

Conclusion

An App Service DNS incident after VNet Integration cannot be diagnosed with a single nslookup from a VM. Prove the precedence between site properties, app settings and VNet DNS, query from the worker, then separate the DNS answer, port 53, TCP, TLS and application behavior.

The final decision should remain reversible: repair the override, resolver path, forwarding or zone; promote after a multi-instance canary; or restore the previous DNS contract. Until the effective resolver is identified, do not add a static mapping or public access merely to make the symptom disappear.