Azure firewall behind AGW

Brajesh Kumar 20 Reputation points
2025-10-28T07:39:14.9333333+00:00

Hi All,

we want to configure azure firewall behind application gateway to translate further to project specific spoke Internal AGW.

Internet client -> HUB Public application gateway -> HUB Azure firewall -> Spoke Internal Application gateway.

  1. Can we configure Azure firewall Private IP as backend pool of Public AGW ?
  2. How to configure health probe for this if not healthy cant forward traffic?
  3. Do we have to force traffic on HUB Public AGW subnet using route to Azure firewall Private IP ?
  4. Do we need to create custom route on Spoke internal AGW for return traffic (only from ingress traffic)?
Azure Firewall
Azure Firewall
An Azure network security service that is used to protect Azure Virtual Network resources.
{count} votes

1 answer

Sort by: Most helpful
  1. Harish Peddapally 1,590 Reputation points Microsoft External Staff Moderator
    2025-10-31T04:10:51.3233333+00:00

    Hi Brajesh Kumar,

    Good day, i hope you are doing great!

    Welcome to Microsoft Q&A and thank you for posting your query here!

    Thank you for your detailed query and discussion here. Below is a consolidated answer on how to configure Azure Firewall behind a public Application Gateway (AGW) forwarding traffic to multiple spoke internal AGWs, addressing your key questions:

    1. Can Azure Firewall Private IP be a Backend Pool for Public AGW?

    Yes, you can configure the Azure Firewall's private IP as a backend pool target in the public AGW. However, keep in mind Azure Firewall is a stateful network device and does not respond to HTTP/S health probes directly like a backend server. Therefore, while the AGW can send traffic to the Firewall’s private IP, the Firewall itself won't respond to Layer 7 health probes.

    Recommendation: Instead of probing the firewall, configure custom health probes on the public AGW that target reachable endpoints behind the firewall, such as health endpoints on internal AGWs, to verify backend health.

    2. How to Configure Health Probes?

    Use custom probes on the public AGW that point to a known healthy path on each internal AGW behind the firewall.

    Alternatively, you can configure the AGW to ignore probe status for the firewall backend, but this is not recommended for production environments.

    This approach ensures the health probe reflects actual backend service status rather than the firewall's health.

    3. Do You Need to Force Traffic on the HUB Public AGW Subnet Using Routes to Azure Firewall?

    Yes. You need to create a User-Defined Route (UDR) on the public AGW subnet in the HUB VNet that directs all outbound traffic (0.0.0.0/0) or specific destination prefixes toward the Azure Firewall’s private IP as the next hop. This forces all egress traffic through the firewall for inspection.

    4. Routing Return Traffic from Spoke Internal AGWs:

    To maintain symmetric routing and ensure return traffic passes back through the firewall:

    Create appropriate custom routes (UDRs) on the internal AGW subnets in the spoke VNets.

    These routes should direct return traffic destined for ingress sources back via the Azure Firewall’s private IP.

    This is critical to keep both requests and responses flowing through your security inspection point.

    5. Multi-Site Listener and DNAT Use Case:

    • For your design where you have multiple client domains (e.g., xyz.com, abc.com) forwarding traffic via the public AGW and firewall to separate internal AGWs:
    • Configure multi-site listeners on the public AGW for each domain.
    • Each listener uses a dedicated HTTP setting with a unique destination port on the firewall backend pool, for example:
    • xyz.com → destination port 8888
    • abc.com → destination port 8889

    On the Azure Firewall, configure DNAT rules that translate traffic based on the destination port (not source port), forwarding to the respective internal AGW private IP and port (typically 443).

    Traffic flow example:

    Client → Public AGW (xyz.com listener) → Azure Firewall Private IP:8888 → DNAT to Internal AGW1:443

    Client → Public AGW (abc.com listener) → Azure Firewall Private IP:8889 → DNAT to Internal AGW2:443

    Summary:

    • Use Azure Firewall private IP in the public AGW backend pool.
    • Use custom health probes targeting internal AGWs behind the firewall.
    • Enforce routing via Azure Firewall by setting UDRs on both public AGW subnet and internal AGG spoke subnets.
    • Use multi-site listeners with unique ports and DNAT rules for different domains/internal AGWs.
    • Maintain symmetric traffic routing through the firewall using appropriate custom routes.
    • This design ensures secure, inspected, and properly routed inbound traffic paths from internet clients through your HUB public AGW, Azure Firewall, and finally to spoke internal AGWs.

    For detailed guidance, you can also refer to Microsoft's official documentation:

    Firewall & Application Gateway example: https://learn.microsoft.com/en-us/azure/architecture/example-scenario/gateway/firewall-application-gateway

    If you have any further questions or need clarification, feel free to ask.

    If the provided information answers your query, do click "Upvote" and "Accept Answer", it will help others who might be facing similar challenges.

    Thanks,

    Harish.

    0 comments No comments

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.