Intermittent Azure IMDS header timeouts in a SYSTEM .NET Framework process

Per Malmström 0 Reputation points
2026-11-26T20:49:48.23+00:00

We are investigating intermittent IMDS connectivity on an Azure Windows x64 VM in Sweden Central (.NET Framework CLR 4.0.30319.42000).

A synchronous HttpWebRequest reads the standard /metadata/instance/compute/vmId endpoint, with Metadata: true, an explicitly disabled proxy, redirects disabled and KeepAlive disabled. The operation has a 20-second total budget and at most two attempts, each capped at 10 seconds.

In the failing operation, both attempts timed out inside GetResponse before response headers arrived (WebExceptionStatus.Timeout/14, no HTTP status, zero response bytes). Cleanup and physical child-process exit were confirmed. The same frozen implementation previously succeeded in an isolated SYSTEM console in about three seconds. Earlier real ServiceBase and console observations also succeeded. These observations occurred at different times and do not establish a service-versus-console cause.

Configuration checks show DHCP enabled and the primary NIC/IP matching Azure. A limited firewall review found no matching SYSTEM rule; this does not rule out all filtering. Metadata Security Protocol/Guest Proxy Agent is not configured. No TCP/IP port-exhaustion events were recorded in the checked failure window, and the later connection-table snapshot contained 41 entries.

The application remains available and deployment stops safely before service or application changes.

Which supported Windows/Azure host diagnostics would help distinguish a guest-side connection problem from IMDS host availability without disabling security controls or increasing retry/time budgets?

No subscription, tenant, VM, account, domain, private address, customer or invoice identifiers are included. No logs or files will be attached.

Azure Virtual Machines
Azure Virtual Machines

An Azure service that is used to provision Windows and Linux virtual machines.


1 answer

Sort by: Most helpful
  1. AI answer

    2026-11-26T20:50:54.55+00:00

    Run the diagnostic-only IMDS Verification Tool together with a circular Windows packet trace during the next occurrence, then correlate the packet outcome with Azure Resource Health and platform-network diagnostics for the same UTC interval.

    1. Establish an independent IMDS result

    From Azure portal → Virtual machine → Operations → Run command, select Windows_IMDSValidation, and then select Run. Without -AutoFix, this is diagnostic only and does not alter certificates, firewall policy, or other security controls. Its first phase tests TCP connectivity to [IP Address]:80; later phases test attestation and certificate handling.^1^

    Run it:

    • Once while the application is healthy, to obtain a baseline.
    • As soon as possible after an application timeout.
    • Without -AutoFix, because the reported failure is before HTTP response headers and the objective is evidence collection, not certificate repair.

    Interpretation:

    • Phase 1 fails concurrently: the problem is below the HTTP response layer.
    • Phase 1 succeeds while the process repeatedly times out: investigate process-specific WFP/security filtering or client behavior.
    • Phase 1 and attestation succeed: this does not explain an earlier transient; use the continuous trace below.

    IMDS is HTTP-only, never leaves the Azure host, and requires proxy bypass plus Metadata: true; the request configuration already satisfies those requirements.^2^

    2. Capture the failing TCP exchange with Pktmon

    On Windows Server 2019 version 1809 or later, Pktmon is an in-box tool that can identify packet propagation and local drop reasons. Use its default circular logging so it can remain armed without unbounded file growth.^3^

    From an elevated prompt:

    pktmon filter remove
    pktmon filter add help
    # Add supported filters for destination [IP Address] and TCP port 80.
    pktmon start -c
    # Leave running until the existing application records its timeout.
    pktmon counters
    pktmon stop
    pktmon etl2txt PktMon.etl
    

    The exact filter switches vary by the Pktmon version, so use pktmon filter add help rather than assuming syntax. Preserve the original ETL and record:

    • UTC start/stop and application timeout times.
    • Process ID and local ephemeral port, if logged by the application.
    • pktmon counters output.
    • Any DropReason and DropLocation.

    Pktmon is the preferred first packet-loss diagnostic because it can attribute local packet loss to Windows stack components. If inconclusive, collect the more verbose Internet Client ETW trace:^4^

    netsh trace start scenario=InternetClient
    rem Reproduce or wait for one bounded application attempt.
    netsh trace stop
    netsh trace convert NetTrace.etl
    

    Classify the exchange:

    • No outbound SYN: guest process, socket, or filtering path.
    • Pktmon/WFP local drop: guest-side filtering or resource problem; the drop reason identifies the next component.
    • SYN retransmissions with no SYN-ACK and no local drop: evidence is consistent with loss beyond the observable guest stack, but does not by itself prove Azure host failure.
    • TCP handshake completes, request leaves, but no HTTP bytes return: preserve the trace for Azure Support.
    • HTTP status appears: this is no longer the reported header-timeout case; inspect the status, including documented IMDS 429, 410, or 500 responses.^2^

    3. Capture WFP decisions without disabling policy

    A limited firewall-rule review does not cover every Windows Filtering Platform provider. For a reproducible occurrence:

    netsh wfp capture start keywords=19
    rem Allow the existing operation to run once.
    netsh wfp capture stop
    

    Inspect wfpdiag.cab → wfpdiag.xml for FWPM_NET_EVENT_TYPE_CLASSIFY_DROP, matching destination [IP Address], port 80, and the executable. The event includes the responsible filter information.^5^

    For sporadic failures, enable WFP packet-drop auditing before the observation period:

    auditpol /set /subcategory:"Filtering Platform Packet Drop" /success:enable /failure:enable
    netsh wfp show state
    

    Correlate Security log drop events by UTC, destination, port, and filter ID; use wfpstate.xml to map the ID to its rule or provider.^6^

    4. Correlate Azure host evidence

    For the exact UTC window:

    1. Open VM → Resource health → Health history. Resource Health retains 30 days and can later publish an Azure platform RCA.^7^
    2. Open Service Health and check service issues, advisories, and maintenance for the subscription and Sweden Central.^8^
    3. Open VM → Diagnose and solve problems:
      • Run the Instance Metadata Service diagnostic.
      • Run Azure insights for Platform Network Validation if offered for this VM.
    4. Review VM → Monitoring → Metrics for host availability and network signals around the same interval. Host metrics are collected by default; guest metrics require enhanced monitoring.^9^

    A healthy Resource Health record does not disprove an IMDS-only transient; it means Azure did not register a resource-level availability event.

    5. Escalation package

    If traces show outbound SYN/request traffic, no local drop, and no response, open an Azure support request under the VM’s Instance Metadata Service problem category. Provide:

    • VM resource reference through the support case—not in a public Q&A post.
    • Region, OS version, and exact UTC windows.
    • IMDS tool output.
    • Pktmon/NetTrace ETL files and WFP result.
    • Local source ports, TCP sequence summary, and attempt durations.
    • Resource Health, Service Health, and platform-network diagnostic results.
    • Confirmation that proxy bypass, Metadata: true, retry limits, and application availability behavior remained unchanged.

    That evidence gives Azure Support the timestamps needed to correlate guest-observed traffic with host and top-of-rack telemetry that is not exposed inside the VM.


    References

    1. Azure VM Instance Metadata Service verification tool
    2. Azure Instance Metadata Service
    3. Pktmon command formatting
    4. Diagnose packet loss
    5. Troubleshooting UWP App Connectivity Issues
    6. Troubleshoot TCP/IP connectivity
    7. Project Flash - Use Azure Resource Health to monitor Azure Virtual Machine availability
    8. Azure Service Health FAQ
    9. Monitor virtual machines in Azure
    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.