ION DocsV3
  • Architecture
    • ION Architecture V2
      • ION V2 — Architecture Overview
      • V2 context
        • V2 capacity model
        • V2 constraints
        • V2 integration boundaries
        • V2 requirements
        • V2 solution strategy
      • V2 Structural Design
        • ION V2 Landscape
        • ION V2 Platform Views
          • ION V2 Delivery and Runway
          • ION V2 Incident-Processing Pipelines
          • ION V2 Platform Networking
          • ION V2 Platform Observability
          • ION V2 Platform Security
        • ION V2 System Context
        • ION V2 Systems
          • Alya System Topology
          • Cogs System Topology
          • Ion IQ System Topology
          • Kingsman System Topology
          • Pigeon System Topology
          • Veritas System Topology
          • Watchtower System Topology
      • V2 evolution and platform lineage
        • Tiberium Origins
          • Tiberium Architecture Overview
          • Tiberium Components Architecture Overview
        • Voyager and the V2 Merge
          • Voyager Architecture Overview
          • Voyager Identity Architecture Overview
          • Voyager Services Architecture Overview
      • V2 Platform Architecture
        • Alya Workbench
          • Mission Brief: Alya (Workbench for Cyber Defenders)
        • Asset Discovery
        • Automation
        • Customer Communications
          • Notification and Escalation Design
        • Reporting and Dashboards
        • Vulnerability Mitigations
      • V2 Well-Architected
        • V2 Reliability
          • Availability Architecture
        • V2 Security
          • API Management
            • API Management Architecture
            • API Management Guidelines
            • API Management Implementation
              • APIM Deployment and Debugging
              • APIM Global Policy Implementation
              • APIM Platform Provisioning
              • APIM Policy Authoring
              • APIM Service Onboarding
              • APIM Webhook Flow Implementation
            • API Management Policy Model
          • V2 Security Architecture
          • Teams Notification Security
          • Customer Data and PII
          • V2 Identity
            • Applications and Authorization
            • V2 Identity Architecture
            • Microsoft Entra ID
            • V2 Identity Standard
            • V2 Identity Implementation
              • Application Registration
              • Application Roles
              • Customer Identity Onboarding
              • Identity Lifecycle and Operations
              • Managed Identity
            • V2 Identity Workflows
              • Alya Workbench Identity Workflow
              • Customer Portal Identity Workflow
              • Microservices Identity Workflow
              • ServiceNow Inbound Identity Workflow
              • Microsoft Teams Identity Workflow
          • Customer Environment Access
            • Customer Environment Access Architecture
            • Customer Environment Access Guidelines
            • Customer Environment Access How-to
    • ION Architecture V3
      • ION V3 Architecture Overview
      • V3 context
        • V3 capacity model
        • V3 constraints
        • V3 integration boundaries
        • V3 requirements
        • V3 solution strategy
      • V3 Structural Design
        • Data and events
          • Archival and retention
          • Event model
          • Event sourcing
          • Event store
          • Micro-frontend interaction
          • Recovery and disaster recovery
          • Replay and reconstruction
          • Reporting and customer analytics
          • Event-sourcing requirements
          • Snapshots
          • UI interaction
        • ION v3 domains
          • Assets domain
            • Assets domain flows
            • Assets domain implementation
            • Assets domain model
          • Customer Collaboration domain
            • Customer Collaboration domain flows
            • Customer Collaboration domain implementation
            • Customer Collaboration domain model
          • Incident domain
            • Incident domain flows
            • Incident domain implementation
            • Incident domain model
          • Investigation domain
            • Investigation domain flows
            • Investigation domain implementation
            • Investigation domain model
          • Remediation domain
            • Remediation domain implementation
            • Remediation domain model
          • Ticket domain
            • Ticket domain flows
            • Ticket domain implementation
            • Ticket domain model
        • ION V3 Landscape
        • ION V3 Platform Views
          • Internal API
            • Internal API architecture
            • Internal API consumer guide
            • Internal API identity and access
            • Internal API implementation
          • Micro-Frontends
            • Micro-Frontends architecture
            • Micro-Frontends capability service (Signet)
            • Micro-Frontends composition
            • Micro-Frontends identity and access
            • Micro-Frontends implementation
            • Micro-Frontends real-time (SignalR)
            • Micro-Frontends routing and ingress
            • Shells and MFEs
          • SOAR Integration
            • SOAR Integration architecture
            • SOAR Integration customer onboarding
            • SOAR Integration Identity and Access Design
            • SOAR Integration implementation
            • SOAR Integration operations
        • ION V3 System Context
        • ION V3 systems
          • Alya
          • Cogs
          • ION IQ
          • Kingsman
          • Pigeon
          • Veritas
          • Watchtower
      • V2 to V3 evolution
        • V2 to V3 architecture delta
        • V2 to V3 decision changes
        • V2 to V3 migration guidance
        • V2 to V3 service impact
      • Well-Architected
        • Cost Optimization
          • Cost Governance
            • Cost Governance Architecture
            • Cost Governance Guidelines
            • Cost Governance Implementation
          • SKU Strategy
            • SKU Strategy Architecture
            • SKU Strategy Guidelines
            • SKU Strategy Implementation
        • Operational excellence
          • Audit Logs
            • Audit Logs Architecture
            • Audit Logs Guidelines
            • Audit Logs Implementation
          • CI/CD Runway
            • CI/CD Runway Architecture
            • CI/CD Runway Guidelines
            • CI/CD Runway Implementation
          • Feature Flags
            • Feature Flags Architecture
            • Feature Flags Guidelines
            • Feature Flags Implementation
          • Incident management
            • Incident management architecture
            • Incident management guidelines
            • Incident management implementation
          • Azure Landing Zone
            • Azure Landing Zone Architecture
            • Azure Landing Zone Guidelines
            • Azure Landing Zone Implementation
          • Notifications
            • Notifications Architecture
            • Notifications Guidelines
            • Notifications Implementation
          • Observability
            • Observability Architecture
            • Observability Guidelines
            • Observability Implementation
        • Performance efficiency
          • Capacity, sizing, and scaling
            • Capacity, sizing, and scaling architecture
            • Capacity, sizing, and scaling guidelines
            • Implement capacity, sizing, and scaling
          • UI responsiveness
            • UI responsiveness architecture
            • UI responsiveness guidelines
            • Implement UI responsiveness
        • V3 reliability
          • Application resilience patterns
          • Critical flows
          • Customer reliability assurance
            • ION Platform reliability and service continuity
            • Customer reliability slides
          • Disaster recovery
            • Disaster recovery architecture
            • Disaster recovery guidelines
            • Disaster recovery implementation
              • DR implementation: API Management
              • DR implementation: App Configuration
              • DR implementation: Application Gateway
              • DR implementation: Azure SQL Database
              • DR implementation: Container Apps
              • DR implementation: Container Registry
              • DR implementation: Cosmos DB
              • DR implementation: Event Hubs
              • DR implementation: Azure Front Door
              • DR implementation: Function Apps
              • DR implementation: Key Vault
              • DR implementation: Log Analytics and Application Insights
              • DR implementation: MySQL Flexible Server (Temporal)
              • DR implementation: PostgreSQL Flexible Server
              • DR implementation: Azure Managed Redis
              • DR implementation: Service Bus
              • DR implementation: SignalR
              • DR implementation: Storage accounts
            • Operational-data replication
            • Disaster recovery operations
          • Edge and routing
            • Azure Application Gateway
              • Azure Application Gateway architecture
              • Azure Application Gateway guidelines
              • Azure Application Gateway implementation
              • Azure Application Gateway resiliency
              • Azure Application Gateway security
            • Azure Front Door
              • Azure Front Door architecture
              • Azure Front Door guidelines
              • Azure Front Door implementation
              • Azure Front Door resiliency
              • Azure Front Door security
          • Event-store disaster recovery (moved)
          • Failure mode analysis
          • Graceful degradation
            • Graceful degradation architecture
            • Graceful degradation guidelines
            • Graceful degradation implementation
          • V3 reliability maturity model
            • V3 reliability maturity assessment
            • Maturity level 2: self-preservation
            • Maturity level 3: recovery readiness
            • Maturity level 4: maintain stability
            • Maturity level 5: stay resilient
          • Multi-region replication
            • Multi-region replication architecture
            • Multi-region replication guidelines
            • Multi-region replication implementation assessment
          • Reliability testing
          • Scaling and headroom
          • Targets and health model
          • Trade-offs and accepted risks
        • V3 Security
          • API Management
            • API Management Architecture
            • API Management Guidelines
            • API Management Implementation
              • API Contracts and Asynchronous Operations
              • APIM Deployment and Debugging
              • APIM Global Policy Implementation
              • APIM Platform Provisioning
              • APIM Policy Authoring
              • APIM Service Onboarding
              • APIM Webhook Flow Implementation
            • API Management Policy Model
          • V3 Security Architecture
          • Data protection
            • Data protection architecture
            • Data protection guidelines
            • Data protection implementation guidelines
              • API Management
              • Application Gateway
              • Azure SQL Database
              • Azure Container Apps
              • Azure Cosmos DB
              • Azure Front Door
              • Azure Function Apps
              • Azure Database for MySQL
              • Azure Database for PostgreSQL
              • Data protection procedures
          • V3 Security Guidelines
          • V3 Identity
            • Applications and Authorization in ION V3
            • V3 Identity Architecture
            • Capabilities
            • Microsoft Entra ID for ION V3
            • V3 Identity Standard
            • V3 Identity Implementation
              • App Service Authentication
              • Application Registration
              • Application Roles
              • Customer Azure RBAC
              • Customer Identity Onboarding
              • Identity Lifecycle and Operations
              • Mailbox-Scoped Access
              • Managed Identity
              • Workload Identity Federation
            • V3 Identity Workflows
              • Alya Workbench Identity Workflow
              • Customer Azure RBAC Identity Workflow
              • Customer Portal Identity Workflow
              • Mailbox Access Identity Workflow
              • Microservices Identity Workflow
              • ServiceNow Inbound Identity Workflow
              • Shell and MFE Identity Workflow
              • Microsoft Teams Identity Workflow
          • Customer Environment Access
            • Azure Lighthouse
              • Azure Lighthouse implementation
            • GDAP and Tenant Governance
              • Access Packages (legacy)
              • GDAP human access implementation
            • Customer environment access guidelines
            • Multi-tenant Entra apps
              • Multi-tenant Entra apps implementation
            • Teams B2B Direct Connect
              • Teams B2B Direct Connect implementation
          • Network Security
            • Network Security Architecture
            • Network Security Guidelines
            • Network Security Implementation
              • Egress and Static IPs
              • Resource Access Restrictions
          • V3 Security Patterns
    • ION Architecture V4
      • How V4 evolves from V3
  • Principles
  • Patterns
    • Application Permissions Only
    • Async REST
    • Audit Logs (Pattern)
    • Auth / AuthZ
    • Dead Letter Queue (DLQ)
    • Dual Writes (and how to avoid them)
    • ECST — Event-Carried State Transfer
    • Event Hubs Throttling
    • Feature Flags (Pattern)
    • Idempotent Write
    • MFE UI Interaction
    • Notifications (Pattern)
    • Private Data Store Access
    • Schema Evolution
    • Service Bus Topic Throttling
    • UI Interaction with an Event-Sourced Backend
  • Standards
    • API Standard
    • API Standards
    • Coding Standard
    • Coding Standards
    • Documentation Standard
    • Documentation Standards
    • Microservice Standard
    • Microservice Checklist
    • Operational Readiness Standard
    • ORR — Operational Readiness Review Checklist
  • Decisions
    • ADR-0001
    • ADR-0002
    • ADR-0003
    • ADR-0004
    • ADR-0005
    • ADR-0006
    • ADR-0007
    • ADR-0008
    • ADR-0009
    • ADR-0010
    • ADR-0011
    • ADR-0012
    • ADR-0013
    • ADR-0014
    • ADR-0015
    • ADR-0016
    • ADR-0017
    • ADR-0018
    • ADR-0019
    • ADR-0020
    • ADR-0021
    • ADR-0022
    • ADR-0023
    • ADR-0024
    • ADR-0025
    • ADR-0026
    • ADR-0027
    • ADR-0028
    • ADR-0029
    • ADR-0030
    • ADR-0031
    • ADR-0032
    • ADR-0033
    • ADR-0034
  • Services
  • Governance
    • Assumptions
    • Discrepancies
    • V3 reference coverage and conflict matrix
OntinueION Docs
  1. Architecture
  2. ION Architecture V3
  3. Well-Architected
  4. V3 reliability
  5. Edge and routing
  6. Azure Front Door
  7. Azure Front Door implementation

Azure Front Door implementation

reliability
architecturev3

Azure Front Door implementation

This page explains how the Front Door configuration is laid out in code and how to add a frontend or an API route. It also lists where the current configuration differs from the guidelines, with the remediation for each gap.

Repository layout

PathContents
rome-ion/infrastructure/hub/azure-front-door/front_door.tfHub module call: profile, hub endpoints, shared origin groups, hub routes, CSP values
rome-ion/infrastructure/hub/azure-front-door/diagnostics_settings.tfAllLogs and AllMetrics to the observability workspace
rome-ion/infrastructure/hub/azure-front-door/alert.tfResource Health alert (enabled in mgtprd)
rome-ion/infrastructure/hub/azure-front-door/dns_zone.tfApex DNS zone and records for hub endpoints
rome-ion/infrastructure/hub/azure-front-door/services/<service>/One service stack per frontend or API hostname (main.tf, providers.tf, variables.tf, environments/*.tfvars)
tf-modules/azure/azure-front-door-premium/Hub module: profile, endpoints, origin groups, origins, routes, rule sets, WAF and security policy
tf-modules/azure/azure-front-door-service/Service module: reads the profile and shared groups; creates one endpoint with its routes, origins, WAF, rule sets, custom domain, and DNS
rome-ion/infrastructure/hub/application-gateway/Application Gateway listeners, rewrite rules, and agw-* DNS records (priority-1 origins)

Current configuration

Each row compares a guideline with the current Terraform. Rows marked Verify depend on configuration outside these stacks, or on Azure state that IaC does not show.

#GuidelineCurrent configurationRemediationOwner
1API group probe interval 60 s or lessRomeApiOriginGroup and RomeAppGatewayDomain use 255 sSet interval_in_seconds = 60 in front_door.tfCPE
2Module defaults match their commentsProbe default is 255 s; the comment says 30 sFix the comment, and set the default to 60 s, in both modulesCPE
3WAF covers every custom domainSecurity policies associate endpoint IDs onlyVerify in the Security policies blade; add custom-domain IDs to the associationCPE
4Per-IP rate limit on /api/*No custom rulesAdd the ruleCPE with SRE
5Shared WAF policy definitionOne identical policy per stackMove to one shared policy; keep per-service policies only for exclusionsCPE
6Cache hashed static assetsCaching off on every routeEnable asset caching per frontendFrontend teams
7Origin name check oncertificate_name_check_enabled = false in both modulesRecorded exception until each origin presents a matching certificateCPE
8Consolidated CSP, no X-XSS-ProtectionFour hub CSP values plus one per stack; X-Xss-Protection rule presentConsolidate CSP values; delete the xxss ruleCPE with frontend teams
9Metric alerts on origin health, 5xx, latency, WAF blocksResource Health alert only (production)Add the metric alertsCPE with SRE
10Modules pinned to JFrog versionsHub and service stacks use local relative module paths; the JFrog v4.8.0 source is commented outPublish the current module and pin every stack to itCPE
11Priority-2 App Service accepts only ION Front DoorAccess restriction allows the AzureFrontDoor.Backend service tag with no X-Azure-FDID header match (for example alya-fe, customer-info-fe, service-management-fe)Add the header matchFrontend teams
12Priority-2 APIM accepts only ION Front DoorNo X-Azure-FDID check in this repositoryVerify the APIM inbound policy; add the check if it is missingAPIM owners
13Priority-2 Static Web Apps accepts only ION Front DoorConfiguration lives in the SWA repositoriesVerify forwardingGateway in staticwebapp.config.json for awkb, ioniq, and lobfeFrontend teams
14Application Gateway accepts Front Door, plus internet 443 only for the exceptionsNSG allows AzureFrontDoor.Backend and also Internet on 443 and 80Remove internet port 80. Per-listener Front Door-only enforcement needs Application Gateway WAF custom rules (target state)CPE
15Wildcard routes end origin_path with /portal.smfe and portal.cife wildcard routes (/api/v1/service-requests/*, /api/v1/customers/*) have no trailing slashVerify the rewritten paths; add the trailing slashCPE
16No new routes on legacy groupsRomeAppGateway (raw IP) and the duplicate RomeAppGatewayDomain remain for Yammer, Herald, and health routesRemove them when Yammer and Herald are retiredCPE
Not a gap

The operational-data storage account (stvshn<env>chn01) has network rules set to Allow. This is intentional. Shared keys are disabled, and every read needs an Entra token with Storage RBAC. IP rules for Front Door are brittle for static websites. See security.

Add a frontend to Front Door

1

Create the service stack

Owner: Service team

Copy hub/azure-front-door/services/test to services/<service>. In providers.tf, change the backend state key to a unique name for the service.

2

Declare the endpoint, origins, and routes

Owner: Service team

In main.tf, set application_short, the single frontend_endpoints entry, the CSP value, and the origin groups. The web app group has a probe. The shared API group never has one.

module "imfe_service" {
  source            = "<jfrog>/azure-front-door-service/azure" # pinned version
  environment_short = var.environment_short
  application_short = "imfe"
  csp_header_value  = "default-src 'self' https://*.${var.rome_domain}; ..." # 640 chars max
  cors_origin_urls  = var.cors_origin_urls

  frontend_endpoints = ["portal.imfe"]

  shared_origin_groups = {
    RomeApiOriginGroup = { health_probe_enabled = false } # hub owns the probe
  }

  service_origin_groups = {
    ImfeWebAppOriginGroup = {
      health_probe_enabled = true
      request_type         = "GET"
      path                 = "/"
      protocol             = "Https"
      interval_in_seconds  = 60
    }
  }

  service_origins = {
    imfe-webapp-agw-primary = {
      origin_group = "ImfeWebAppOriginGroup"
      host_name    = "agw-imfe-webapp.${var.rome_domain}"
      priority     = 1
    }
    imfe-webapp-host-secondary = {
      origin_group = "ImfeWebAppOriginGroup"
      host_name    = var.endpoint # App Service or Static Web Apps default hostname
      priority     = 2
    }
  }

  service_routes = {
    imfe-webapp = {
      frontend_endpoint             = "portal.imfe"
      origin_group                  = "ImfeWebAppOriginGroup"
      origin                        = ["imfe-webapp-agw-primary", "imfe-webapp-host-secondary"]
      forwarding_protocol           = "HttpsOnly"
      patterns_to_match             = "/*"
      supported_protocols           = ["Http", "Https"]
      origin_path                   = "/"
      preserve_unmatched_path       = true
      cache_enabled                 = false
      query_string_caching_behavior = ""
      query_strings                 = []
      compression_enabled           = false
      content_types_to_compress     = []
      cdn_frontdoor_rules           = ["securityheaders", "cors"]
    }
  }

  shared_routes = {} # API routes, see "Add an API route"
}
3

Add environment tfvars

Owner: Service team

Create environments/mgmt-alpha.tfvars, mgmt-beta.tfvars, mgmt-gamma.tfvars, and mgmt-prod.tfvars. Each sets environment_short (mgtapa, mgtbta, mgtgma, mgtprd), rome_domain, and cors_origin_urls, using exact https:// origins only.

4

Add the Application Gateway listener

Owner: Service team with CPE

In hub/application-gateway, add the agw-<app>-webapp A record, the listener, and the backend pool. Add the security-header rewrite rule, conditioned on X-Azure-FDID not matching the ION profile GUID. Mirror any /api/* path rewrites the portal needs, so the outage bypass works.

5

Lock down the SPA host

Owner: Service team

Restrict the priority-2 host to the Application Gateway subnet, ION’s Front Door (service tag plus X-Azure-FDID), the ZPA subnet (engineer access only), and deployment runners. See lock down a priority-2 origin.

6

Register identity and CORS

Owner: Service team

Add both https://portal.<app>.<domain> and https://agw-<app>-webapp.<domain> as Entra redirect URIs and as APIM CORS origins. The second hostname makes the portal bypass-capable.

7

Open a PR and deploy through CPE

Owner: Service team and CPE

Open the PR with the plan output. CPE deploys through Runway in mgtapa, mgtbta, mgtgma, and then mgtprd.

8

Verify

Owner: Service team

For each environment, confirm the following:

  • the custom domain shows Approved with a managed certificate;
  • the WAF security policy lists the custom domain;
  • the response carries the expected headers;
  • both origins in the web app group report healthy;
  • in mgtapa, disabling the priority-1 origin moves traffic to priority 2.

Add an API route

API routes are shared_routes on the service endpoint. They target RomeApiOriginGroup and rewrite the public prefix to the APIM API path.

A new MFE MUST use one catch-all route to its own BFF’s APIM API (micro-frontends routing):

shared_routes = {
  iwkb-api = {
    frontend_endpoint             = "portal.iwkb"
    origin_group                  = "RomeApiOriginGroup"
    origin                        = "rome-appgateway-primary"
    forwarding_protocol           = "HttpsOnly"
    patterns_to_match             = "/api/*"
    supported_protocols           = ["Http", "Https"]
    origin_path                   = "/rebff-ext/"   # trailing slash
    preserve_unmatched_path       = true
    cache_enabled                 = false
    query_string_caching_behavior = ""
    query_strings                 = []
    compression_enabled           = false
    content_types_to_compress     = []
    cdn_frontdoor_rules           = ["cors"]
  }
}

The per-resource style below, an exact route and a wildcard route as a pair, is used by the transitional Alya-family routes. Do not use it for a new MFE:

shared_routes = {
  imfe-api-v1-incidents = {
    frontend_endpoint             = "portal.imfe"
    origin_group                  = "RomeApiOriginGroup"
    origin                        = "rome-appgateway-primary"
    forwarding_protocol           = "HttpsOnly"
    patterns_to_match             = "/api/v1/incidents"
    supported_protocols           = ["Http", "Https"]
    origin_path                   = "/imfe-bff-ext/v1/incidents"   # no trailing slash
    preserve_unmatched_path       = true
    cache_enabled                 = false
    query_string_caching_behavior = ""
    query_strings                 = []
    compression_enabled           = false
    content_types_to_compress     = []
    cdn_frontdoor_rules           = ["cors"]
  }
  imfe-api-v1-incident-resources = {
    frontend_endpoint             = "portal.imfe"
    origin_group                  = "RomeApiOriginGroup"
    origin                        = "rome-appgateway-primary"
    forwarding_protocol           = "HttpsOnly"
    patterns_to_match             = "/api/v1/incidents/*"
    supported_protocols           = ["Http", "Https"]
    origin_path                   = "/imfe-bff-ext/v1/incidents/"  # trailing slash
    preserve_unmatched_path       = true
    cache_enabled                 = false
    query_string_caching_behavior = ""
    query_strings                 = []
    compression_enabled           = false
    content_types_to_compress     = []
    cdn_frontdoor_rules           = ["cors"]
  }
}

imfe-bff-ext is an illustrative APIM API path. Use the path of the API published in APIM. origin = "rome-appgateway-primary" is only a Terraform dependency: the origin group still fails over to rome-apim-primary.

Enable caching for hashed assets

Add a dedicated route for the asset path and keep the catch-all SPA route uncached. The origin must send Cache-Control: public, max-age=31536000, immutable for hashed files.

imfe-webapp-static = {
  frontend_endpoint             = "portal.imfe"
  origin_group                  = "ImfeWebAppOriginGroup"
  origin                        = ["imfe-webapp-agw-primary", "imfe-webapp-host-secondary"]
  forwarding_protocol           = "HttpsOnly"
  patterns_to_match             = "/static/*"       # the bundler's hashed-asset folder
  supported_protocols           = ["Http", "Https"]
  origin_path                   = "/static/"
  preserve_unmatched_path       = true
  cache_enabled                 = true
  query_string_caching_behavior = "IgnoreQueryString"
  query_strings                 = []
  compression_enabled           = true
  content_types_to_compress     = ["application/javascript", "text/css", "image/svg+xml", "font/woff2"]
  cdn_frontdoor_rules           = ["securityheaders", "cors"]
}

index.html, config.js, and mf-manifest.json MUST stay on the uncached catch-all route.

Lock down a priority-2 origin

For App Service, add the X-Azure-FDID header match to the Front Door access restriction. If the shared linux-web-app module does not expose headers yet, extend the module first.

data "azurerm_cdn_frontdoor_profile" "rome" {
  name                = "fd-rome-${var.hub_environment_short}-glb-02"
  resource_group_name = "rg-rome-${var.hub_environment_short}-chn-01"
}

ip_restriction {
  name        = "AzureFrontDoor"
  priority    = 102
  action      = "Allow"
  service_tag = "AzureFrontDoor.Backend"
  headers {
    x_azure_fdid = [data.azurerm_cdn_frontdoor_profile.rome.resource_guid]
  }
}

For Static Web Apps, set networking.allowedIpRanges to the Front Door service tag. Then set forwardingGateway.requiredHeaders to X-Azure-FDID with the profile GUID, injected at build time from Terraform output.

Add the edge rate-limit rule

Add a custom rule to the WAF policy. Base the threshold on measured peak per-client traffic. It should stop floods, not busy analysts.

custom_rule {
  name                           = "ApiPerIpRateLimit"
  enabled                        = true
  priority                       = 100
  type                           = "RateLimitRule"
  rate_limit_duration_in_minutes = 1
  rate_limit_threshold           = var.api_rate_limit_per_minute
  action                         = "Block"

  match_condition {
    match_variable = "RequestUri"
    operator       = "Contains"
    match_values   = ["/api/"]
  }
}

Roll it out in Log action first in mgtgma, review the WAF log, and then switch to Block.

Add the metric alerts

Add one azurerm_monitor_metric_alert per signal in the hub stack, scoped to the profile and routed to the CPE action group.

resource "azurerm_monitor_metric_alert" "afd_origin_health" {
  name                = "alert-afd-origin-health-${var.environment_short}"
  resource_group_name = "rg-rome-${var.environment_short}-chn-01"
  scopes              = [module.afd.id]
  severity            = 1
  frequency           = "PT1M"
  window_size         = "PT5M"

  criteria {
    metric_namespace = "Microsoft.Cdn/profiles"
    metric_name      = "OriginHealthPercentage"
    aggregation      = "Average"
    operator         = "LessThan"
    threshold        = 90
  }

  action {
    action_group_id = data.azurerm_monitor_action_group.cpe_ag.id
  }
}
AlertMetricAggregationSuggested condition
Origin healthOriginHealthPercentageAverageBelow 90 for 5 minutes, split by origin group
ErrorsPercentage5XXAverageAbove 5 for 5 minutes
LatencyTotalLatencyAverageAbove twice the baseline for 10 minutes
WAF blocksWebApplicationFirewallRequestCount (action Block)TotalDynamic threshold, high sensitivity

Diagnose an edge failure

  1. Is it Front Door? Check Resource Health for the profile. If Front Door is down, use the manual bypass runbook.
  2. Is it the WAF? A 403 with a Front Door tracking reference, and a matching WAF log entry, means the WAF blocked the request.
  3. Is it an origin? Check the health probe log and origin health. A failover to priority 2 means Application Gateway, or its path to the origin, is unhealthy.
  4. Is it behind Application Gateway? Follow the same request through Application Gateway access logs, APIM diagnostics, and the BFF using the correlation ID.

The diagnostic setting writes to the AzureDiagnostics table. Confirm the column names in the workspace before you rely on these queries.

// 5xx by route over the last hour
AzureDiagnostics
| where TimeGenerated > ago(1h)
| where Category == "FrontDoorAccessLog"
| summarize requests = count(), errors = countif(toint(httpStatusCode_s) >= 500)
    by bin(TimeGenerated, 5m), routeName_s
| extend errorRate = round(100.0 * errors / requests, 2)
| order by TimeGenerated desc
// WAF blocks by rule over the last 24 hours
AzureDiagnostics
| where TimeGenerated > ago(24h)
| where Category == "FrontDoorWebApplicationFirewallLog" and action_s == "Block"
| summarize blocks = count() by ruleName_s, host_s
| order by blocks desc

Related pages

  • Architecture
  • Resiliency
  • Security
  • Guidelines
  • Micro-frontends routing and ingress
  • ADR-0015 — Layered edge

On this page

  • Repository layout
  • Current configuration
  • Add a frontend to Front Door
  • Add an API route
  • Enable caching for hashed assets
  • Lock down a priority-2 origin
  • Add the edge rate-limit rule
  • Add the metric alerts
  • Diagnose an edge failure
  • Related pages
PreviousAzure Front Door guidelines
NextAzure Front Door resiliency
Edit on GitHubSecurity