Skip to content

Mission-Critical SaaS Architecture with Azure API Management and Global Load Balancing

Executive Summary

This document provides architecture guidance for building a mission-critical SaaS application hosted on Azure with multi-regional deployment for high availability (HA) and disaster recovery (DR). The architecture leverages Azure Front Door with WAF for global load balancing and Azure API Management (APIM) as the API Gateway for microservices.

Key Question Addressed

Do I need an Application Gateway with WAF before the APIM in this architecture?

Short Answer: Generally No - when using Azure Front Door Premium with WAF for a mission-critical architecture, you typically do not need an additional Application Gateway with WAF in front of API Management. Azure Front Door provides comprehensive WAF capabilities at the global edge, and adding Application Gateway creates operational complexity without significant benefit.

However, there are specific scenarios where Application Gateway may be beneficial, which are detailed in this document.


Architecture Overview

flowchart TB
    subgraph Internet["Internet"]
        Users[("Global Users")]
    end

    subgraph AFD["Azure Front Door Premium"]
        direction TB
        WAF["Web Application Firewall<br/>(OWASP Rules, Bot Protection,<br/>Rate Limiting, Geo-filtering)"]
        GLB["Global Load Balancing<br/>(Latency-based routing)"]
        Cache["Edge Caching<br/>(Static Content)"]
        TLS["TLS Termination"]
    end

    subgraph Region1["Region 1 (Primary)"]
        subgraph APIM1["API Management"]
            GW1["API Gateway"]
            Policies1["Policies & Transformations"]
        end
        subgraph Services1["Microservices"]
            MS1A["Service A"]
            MS1B["Service B"]
            MS1C["Service C"]
        end
        DB1[(Database<br/>Replica)]
    end

    subgraph Region2["Region 2 (Secondary)"]
        subgraph APIM2["API Management"]
            GW2["API Gateway"]
            Policies2["Policies & Transformations"]
        end
        subgraph Services2["Microservices"]
            MS2A["Service A"]
            MS2B["Service B"]
            MS2C["Service C"]
        end
        DB2[(Database<br/>Replica)]
    end

    subgraph GlobalDB["Global Data Layer"]
        CosmosDB[("Azure Cosmos DB<br/>Multi-Region Writes")]
    end

    Users --> AFD
    WAF --> GLB
    GLB --> TLS
    TLS --> Cache

    AFD -->|"Private Link<br/>(Premium)"| APIM1
    AFD -->|"Private Link<br/>(Premium)"| APIM2

    APIM1 --> Services1
    APIM2 --> Services2

    Services1 --> DB1
    Services2 --> DB2

    DB1 -.->|Sync| CosmosDB
    DB2 -.->|Sync| CosmosDB

Traffic Flow Analysis

Request Flow Through the Architecture

sequenceDiagram
    participant Client as Global Client
    participant AFD as Azure Front Door<br/>(Global Edge)
    participant WAF as WAF<br/>(Edge Protection)
    participant APIM as API Management<br/>(Regional Gateway)
    participant Backend as Microservices<br/>(Backend)

    Client->>+AFD: HTTPS Request
    Note over AFD: Anycast routing to<br/>nearest edge POP

    AFD->>+WAF: Inspect Request
    Note over WAF: OWASP Rules<br/>Bot Protection<br/>Rate Limiting<br/>Geo-filtering

    alt Request Blocked
        WAF-->>Client: 403 Forbidden
    else Request Allowed
        WAF->>AFD: Request Valid
    end

    AFD->>+APIM: Forward via Private Link<br/>(Lowest latency region)
    Note over APIM: JWT Validation<br/>Rate Limiting<br/>Request Transformation<br/>Caching

    APIM->>+Backend: Route to Service
    Backend-->>-APIM: Response
    APIM-->>-AFD: API Response
    AFD-->>-Client: Response<br/>(via edge cache if applicable)

Why Application Gateway is NOT Required

Azure Front Door WAF Capabilities

Azure Front Door Premium provides comprehensive WAF capabilities that eliminate the need for Application Gateway WAF in most scenarios:

Capability Front Door WAF Application Gateway WAF
OWASP Core Rule Sets ✅ CRS 3.2+ ✅ CRS 3.2+
DDoS Protection ✅ Built-in (Layer 7) ❌ Requires separate DDoS
Bot Protection ✅ Native ❌ Limited
Rate Limiting ✅ Native ❌ Requires custom rules
Geo-filtering ✅ Native ❌ Limited
Global Scale ✅ Edge locations worldwide ❌ Regional only
Managed Certificates ✅ Automatic renewal ✅ Manual/Key Vault

Key Recommendations from Microsoft

"Enable WAF capabilities at a single service location, either globally with Azure Front Door or regionally with Azure Application Gateway, since this simplifies configuration fine tuning and optimizes performance and cost."Mission-Critical Networking Connectivity

"Prioritize the use of Azure Front Door WAF since it provides the richest Azure-native feature set and applies protections at the global edge, which simplifies the overall design and drives further efficiencies."Mission-Critical Application Delivery


Architecture Decision: Front Door → APIM Direct Connection

flowchart LR
    subgraph "Recommended: Direct Connection"
        A1[Front Door<br/>Premium + WAF] -->|Private Link| B1[API Management]
        B1 --> C1[Microservices]
    end

    style A1 fill:#28a745,color:#fff
    style B1 fill:#28a745,color:#fff
    style C1 fill:#28a745,color:#fff
Benefit Description
Simplified Operations Single WAF configuration point to manage
Reduced Latency Fewer network hops
Cost Optimization No Application Gateway licensing costs
Unified Security Consistent WAF rules across all traffic
Private Connectivity Front Door Premium supports Private Link to APIM

When Application Gateway Might Be Needed

flowchart LR
    subgraph "Alternative: With Application Gateway"
        A2[Front Door<br/>Premium + WAF] --> B2[Application<br/>Gateway + WAF]
        B2 --> C2[API Management]
        C2 --> D2[Microservices]
    end

    style A2 fill:#ffc107,color:#000
    style B2 fill:#ffc107,color:#000
    style C2 fill:#ffc107,color:#000
    style D2 fill:#ffc107,color:#000

Consider Application Gateway only in these specific scenarios:

Scenario Reason
Global Routing Redundancy Traffic Manager + Application Gateway as fallback when Front Door is unavailable
Internal VNET Only Access APIM deployed in internal mode requiring regional WAF
Strict Compliance Requirements Specific regulatory needs for dual-layer WAF inspection
Legacy Integration Existing Application Gateway deployments that cannot be migrated

Multi-Region Deployment Pattern

Active-Active Multi-Region Architecture

flowchart TB
    subgraph Global["Global Layer"]
        AFD["Azure Front Door Premium<br/>+ WAF Policy"]
    end

    subgraph Region1["West Europe"]
        direction TB
        APIM1["API Management<br/>(Premium - 3 Units)<br/>Zone Redundant"]
        AKS1["AKS Cluster<br/>(Microservices)"]
        DB1[("Cosmos DB<br/>Multi-region Write")]
    end

    subgraph Region2["East US"]
        direction TB
        APIM2["API Management<br/>(Premium - 3 Units)<br/>Zone Redundant"]
        AKS2["AKS Cluster<br/>(Microservices)"]
        DB2[("Cosmos DB<br/>Multi-region Write")]
    end

    subgraph Region3["Southeast Asia"]
        direction TB
        APIM3["API Management<br/>(Premium - 3 Units)<br/>Zone Redundant"]
        AKS3["AKS Cluster<br/>(Microservices)"]
        DB3[("Cosmos DB<br/>Multi-region Write")]
    end

    AFD -->|"Latency-based<br/>Routing"| APIM1
    AFD -->|"Latency-based<br/>Routing"| APIM2
    AFD -->|"Latency-based<br/>Routing"| APIM3

    APIM1 --> AKS1
    APIM2 --> AKS2
    APIM3 --> AKS3

    AKS1 --> DB1
    AKS2 --> DB2
    AKS3 --> DB3

    DB1 <-.->|"Global Replication"| DB2
    DB2 <-.->|"Global Replication"| DB3
    DB1 <-.->|"Global Replication"| DB3

API Management Multi-Region Configuration

For Premium tier APIM, you can deploy the gateway component to multiple regions:

Configuration Details
Tier Required Premium (Classic)
Primary Region Management plane + Developer portal + Gateway
Secondary Regions Gateway only (configuration synced within ~10 seconds)
Availability Zones Enable across 3 zones per region
Minimum Units 3 units per region for zone redundancy

Security Architecture

Defense in Depth Model

flowchart TB
    subgraph Layer1["Layer 1: Edge Protection"]
        direction LR
        DDoS["Azure DDoS<br/>Protection"]
        AFDWAF["Front Door WAF<br/>(OWASP Rules)"]
        GeoFilter["Geo-Filtering"]
        RateLimit["Rate Limiting"]
    end

    subgraph Layer2["Layer 2: Network Security"]
        direction LR
        PrivateLink["Private Link<br/>Connection"]
        NSG["Network Security<br/>Groups"]
        VNET["Virtual Network<br/>Integration"]
    end

    subgraph Layer3["Layer 3: API Gateway Security"]
        direction LR
        JWT["JWT Validation"]
        OAuth["OAuth 2.0"]
        APIKey["Subscription Keys"]
        IPFilter["IP Filtering"]
    end

    subgraph Layer4["Layer 4: Application Security"]
        direction LR
        ManagedID["Managed Identities"]
        KeyVault["Key Vault<br/>Secrets"]
        Entra["Microsoft Entra ID"]
    end

    Layer1 --> Layer2
    Layer2 --> Layer3
    Layer3 --> Layer4

Security Best Practices

Security Control Implementation
TLS Configuration Minimum TLS 1.2, prefer TLS 1.3
Certificate Management Front Door Managed Certificates (auto-renewal)
WAF Mode Prevention mode in production
Origin Protection Validate X-Azure-FDID header + Private Link
API Authentication OAuth 2.0 with Microsoft Entra ID
Secret Management Azure Key Vault with Managed Identities

Locking Down APIM to Accept Only Front Door Traffic

Header-Based Validation (Required)

Configure APIM policies to validate that requests originate from your specific Front Door instance:

<inbound>
    <base />
    <!-- Validate the X-Azure-FDID header -->
    <check-header name="X-Azure-FDID" 
                  failed-check-httpcode="403" 
                  failed-check-error-message="Not authorized" 
                  ignore-case="true">
        <value>YOUR-FRONT-DOOR-ID</value>
    </check-header>
</inbound>
flowchart LR
    subgraph Internet
        Users((Users))
    end

    subgraph "Azure Front Door Premium"
        AFD[Front Door<br/>+ WAF]
    end

    subgraph "Azure Private Network"
        PE[Private<br/>Endpoint]
        APIM[API Management<br/>Internal Mode]
    end

    Users -->|HTTPS| AFD
    AFD -->|"Private Link<br/>(Microsoft Backbone)"| PE
    PE -->|Private| APIM

    style PE fill:#28a745,color:#fff

High Availability Configuration

Availability Zone Distribution

flowchart TB
    subgraph Region["Azure Region"]
        subgraph Zone1["Availability Zone 1"]
            APIM1["APIM Unit 1<br/>(2 VMs)"]
            AKS1["AKS Nodes"]
        end

        subgraph Zone2["Availability Zone 2"]
            APIM2["APIM Unit 2<br/>(2 VMs)"]
            AKS2["AKS Nodes"]
        end

        subgraph Zone3["Availability Zone 3"]
            APIM3["APIM Unit 3<br/>(2 VMs)"]
            AKS3["AKS Nodes"]
        end

        LB[Internal Load Balancer<br/>Zone-redundant]
    end

    LB --> APIM1
    LB --> APIM2
    LB --> APIM3

SLA Composition

Component Individual SLA Notes
Azure Front Door 99.99% Global service with built-in redundancy
API Management (Premium, Zone Redundant) 99.99% With 3+ zones enabled
Azure Cosmos DB (Multi-region) 99.999% Multi-region writes
Composite SLA ~99.97%+ Based on architecture design

Cost Considerations

Component Costs (Approximate)

Component Configuration Monthly Estimate
Front Door Premium 1 profile + WAF ~$350/month base
APIM Premium 3 units × 3 regions ~$8,400/month
Application Gateway (if added) 3 instances × 3 regions ~$1,800/month additional

Cost Optimization Recommendations

  1. Avoid Redundant WAF: Using Front Door WAF eliminates need for Application Gateway WAF
  2. Right-size APIM Units: Use capacity metrics to determine optimal unit count
  3. Leverage Front Door Caching: Reduces load on APIM and backend services
  4. Use Reserved Capacity: Consider reserved pricing for predictable workloads

Alternative Architecture: Redundant Ingress Path

For extreme reliability requirements where you need redundancy against Azure Front Door unavailability:

flowchart TB
    subgraph DNS["DNS Layer"]
        TM1["Traffic Manager<br/>(Weighted Routing)"]
    end

    subgraph Primary["Primary Path (100% traffic)"]
        AFD["Azure Front Door<br/>+ WAF"]
    end

    subgraph Secondary["Secondary Path (Failover)"]
        TM2["Traffic Manager<br/>(Performance Routing)"]
        AG1["Application Gateway<br/>Region 1 + WAF"]
        AG2["Application Gateway<br/>Region 2 + WAF"]
    end

    subgraph Backend["Backend"]
        APIM1["APIM Region 1"]
        APIM2["APIM Region 2"]
    end

    TM1 -->|"Primary"| AFD
    TM1 -->|"Disabled<br/>(Enable on failover)"| TM2

    AFD --> APIM1
    AFD --> APIM2

    TM2 --> AG1
    TM2 --> AG2
    AG1 --> APIM1
    AG2 --> APIM2

Warning: This redundant architecture significantly increases operational complexity. Both WAF configurations must be kept in sync, and testing becomes more complex. Only implement if your SLA requirements demand it.


Recommendations Summary

✅ DO

  • Use Azure Front Door Premium with WAF for global load balancing
  • Enable Private Link between Front Door and APIM
  • Deploy APIM in Premium tier with multi-region configuration
  • Enable Availability Zones across at least 3 zones
  • Configure WAF in Prevention mode with CRS 3.2+
  • Implement header validation to ensure traffic originates from Front Door
  • Use managed certificates for TLS

❌ DON'T

  • Add Application Gateway WAF when Front Door WAF is sufficient
  • Enable WAF at multiple layers without clear justification
  • Use single-region deployment for mission-critical workloads
  • Expose APIM directly to the internet without origin protection
  • Skip health probes configuration on Front Door

Implementation Checklist

  • [ ] Deploy Azure Front Door Premium profile
  • [ ] Configure WAF policy with OWASP CRS 3.2+ rules
  • [ ] Enable bot protection and rate limiting
  • [ ] Deploy APIM Premium tier in primary region
  • [ ] Enable availability zone redundancy (3 zones minimum)
  • [ ] Add secondary regions to APIM
  • [ ] Configure Private Link from Front Door to APIM
  • [ ] Implement X-Azure-FDID header validation in APIM policies
  • [ ] Configure health probes on Front Door
  • [ ] Set up Azure Monitor alerts for both services
  • [ ] Test failover scenarios between regions
  • [ ] Document runbooks for incident response

References

  1. Networking and connectivity for mission-critical workloads on Azure
  2. Architecture best practices for Azure API Management
  3. Reliability in Azure API Management
  4. Connect Azure Front Door Premium to API Management with Private Link
  5. Mission-critical global HTTP ingress
  6. Protect APIs using Application Gateway and API Management
  7. Architecture best practices for Azure Front Door
  8. Plan for application delivery - Cloud Adoption Framework
  9. Load balancing options - Azure Architecture Center

Document Version: 1.0
Last Updated: December 18, 2025
Author: Generated with Azure Architecture Guidance