Can Azure App Service on Linux provide a timestamped NSG deny record for one outbound TCP connection?

David de Moraes 0 Reputation points
2026-11-23T22:54:48.51+00:00

I’m planning a test on Azure App Service on Linux using a custom container and regional VNet integration. Public ingress would remain disabled. Application outbound traffic would route through the delegated integration subnet, where an NSG rule would deny outbound traffic.

The container would make one IPv4 TCP connection attempt to a controlled test endpoint on port 443, without sending application data. It would record the source and destination IPs and ports, protocol, and UTC times immediately before and after the attempt.

Can Azure provide a platform-generated record that ties an outbound deny to that exact connection? I’m looking for the TCP five-tuple, the enforcing rule or resource, and the UTC time of the deny event, with its timestamp precision. If Azure translates the source IP or port, can the record be correlated to the original tuple?

Microsoft Learn lists App Service as unsupported by both VNet flow logs and NSG flow logs. Is there another supported diagnostic or support-assisted trace that can provide this evidence while leaving the network rules in place? A connection timeout or an effective-rule listing alone cannot establish what happened to that specific attempt.

Azure App Service
Azure App Service

Azure App Service is a service used to create and deploy scalable, mission-critical web apps.

0 comments No comments

1 answer

Sort by: Oldest
  1. AI answer

    2026-11-23T22:56:52.2866667+00:00

    Azure App Service on Linux with regional VNet integration cannot produce a supported platform-generated NSG deny record for that individual connection; obtaining enforcement evidence requires moving the deny to a customer-controlled, logging-capable firewall or network virtual appliance (NVA).

    Evidence available in the current topology

    Requested evidence Available from the App Service/NSG path?
    TCP five-tuple for the denied attempt No
    NSG and rule that enforced the deny No per-attempt record
    UTC deny-event timestamp and precision No
    Pre-/post-SNAT tuple correlation No supported record from which to correlate
    Application-side timestamps or packet capture Yes, but not proof of NSG enforcement
    Effective-rule or simulated-rule result Yes, but not proof that the attempt reached that rule

    Although an NSG on the integration subnet can block App Service outbound traffic, the virtual interfaces used by App Service workers are not customer-accessible resources.^1^ More specifically, Microsoft documents that:

    • App Service plans do not support NSG flow logs.^2^
    • App Service plans do not support VNet flow logs.^3^
    • App Service VNet-integration traffic does not appear in Network Watcher or NSG flow logs because of how the integration operates.^4^

    Therefore, the VNet-flow-log fields that would ordinarily contain the tuple, deny state, ACL/rule identifier, and event time are unavailable for this workload. Where supported, those logs are collected at one-minute intervals and include a UNIX-epoch flow timestamp, but that format and collection behavior cannot be applied to App Service here.^3^

    NSG diagnostics does not close the gap: it simulates a supplied flow and reports which rule would allow or deny it. Its supported targets are VMs, NICs, VM scale-set NICs, and certain Application Gateway v2 deployments—not App Service.^5^ Even for a supported target, simulation is not an observation of the actual connection attempt.

    No documented public App Service diagnostic or support-assisted trace provides the requested NSG enforcement artifact. A support case can investigate unexpected platform behavior, but it should not be treated as a supported way to obtain an otherwise unavailable per-flow audit record.

    What a container-side capture can establish

    A capture taken inside the custom container can preserve its local five-tuple and show whether a SYN was emitted. It cannot show that the integration-subnet NSG received the packet, identify the matching NSG rule, or distinguish an NSG drop from a later routing or filtering drop.

    Microsoft’s documented Linux App Service tcpdump procedure applies to Linux apps that do not use a custom container.^6^ For your custom container, any included capture tooling remains application-side evidence only.

    Architectural alternative: enforce and log the deny downstream

    For auditable per-attempt enforcement, place a logging-capable Azure Firewall or NVA in the outbound path:

    1. Enable Route All for the App Service VNet integration so public-destination traffic enters the VNet.
    2. Associate a route table with the delegated integration subnet.
    3. Add a UDR for the controlled destination—or 0.0.0.0/0—whose next hop is the firewall/NVA private IP. App Service supports UDRs on its integration subnet.^1^
    4. Do not let the integration-subnet NSG deny this test tuple. Change that specific rule to allow, narrow its scope, or add a higher-priority allow for the controlled endpoint. Otherwise, the NSG drops the packet before the logging component sees it. Unrelated NSG rules can remain.
    5. Configure the deny on the firewall/NVA and enable its diagnostic logging before running the test.
    6. Verify beforehand that the selected product records:
      • UTC timestamp and documented precision
      • source and destination IP and port
      • protocol and action
      • matching policy/rule identity
      • translation/session data sufficient to map pre-NAT and post-NAT tuples
    7. Run one uniquely identifiable attempt and correlate it using the application’s UTC interval and tuple.

    A UDR to a firewall/NVA overrides other outbound methods, including NAT Gateway.^7^ This design requires permission to deploy/configure the enforcement resource and modify the integration subnet’s route table and App Service routing. It also adds firewall/NVA and log-ingestion costs.

    The available documentation does not specify an Azure Firewall diagnostic category, query, timestamp precision, or guaranteed pre-/post-NAT field mapping for this exact requirement. Those details must be validated against the selected enforcement product before treating its logs as compliance evidence.


    References

    1. Integrate your app with an Azure virtual network
    2. Flow logging for network security groups
    3. Virtual network flow logs
    4. Troubleshoot outbound connectivity with NAT gateway and Azure services
    5. NSG diagnostics overview
    6. Troubleshoot virtual network integration with Azure App Service
    7. Outbound internet access: control egress from Azure (modernize)
    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.