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 Application Gateway
  7. Azure Application Gateway implementation

Azure Application Gateway implementation

reliability
architecturev3

Azure Application Gateway implementation

This page explains how the gateway is laid out in code, how to add a listener and backend, how to run the regression suite, and where the current configuration differs from the guidelines, with the remediation for each gap.

Repository layout

PathContents
rome-ion/infrastructure/hub/application-gateway/application_gateway.tfModule call: listener, pool, settings, probe, rewrite, path-map, and rule lists. Global CORS rules. Routing-rule priorities
rome-ion/infrastructure/hub/application-gateway/data-<app>-fe.tfOne file per frontend: locals for its listener, pool, probe, settings, rewrite sets, and path map
rome-ion/infrastructure/hub/application-gateway/data.tfBackend endpoint locals and the CSP header variants
rome-ion/infrastructure/hub/application-gateway/dns.tfOne agw-* A record per hostname
rome-ion/infrastructure/hub/application-gateway/alert.tfResource Health alert
rome-ion/infrastructure/hub/application-gateway/variables.tf and environments/mgmt-*.tfvarsDomain, certificate secret ID, and Static Web Apps endpoints per environment
rome-ion/infrastructure/hub/application-gateway/scripts/get_cert_renewal_status.pyManual certificate-order check. Not scheduled
tf-modules/azure/application-gateway/Module: public IP, gateway resource, identity, SSL policy, zones, autoscale, dynamic blocks for the lists above
rome-ion/infrastructure/hub/networking/nsgs.tf and subnets.tfGateway subnet, service endpoints, and NSG rules
rome-ion/infrastructure/hub/hub-test-suite/Post-deployment regression suite for the gateway and Front Door

Current configuration

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

#GuidelineCurrent configurationRemediationOwner
1Probe interval 10 to 15 s, timeout 5 to 10 s, threshold 2 to 330 s, 30 s, 3 on every probeTighten the probesCPE
2Zones in every environment. Min and max capacity as variablesZones, min 2, and max 10 hardcoded in the moduleAdd min_capacity and max_capacity variables. Keep zones fixed. Alpha and beta MAY set a lower minimumCPE
3Metric alerts for unhealthy hosts, backend 5xx, failed requests, capacity, connect timeNo metric alertsAdd the metric alertsCPE with SRE
4Resource Health alert in every environmenthealth_alert_for_resources_enabled is true only for mgtprdEnable in every environmentCPE
5Certificate near-expiry alertNo alert. get_cert_renewal_status.py is manual and checks App Service Certificate ordersAdd a Key Vault near-expiry alert for the wildcard certificateCPE
6Connection draining on multi-instance poolsNot configured. The module does not expose itAdd connection_draining to the module settings block, then enable per pool (guideline)CPE
7No cookie affinity, including SignalRAlya-sigr-BackendHttpSettings has affinity enabled (SigrApplicationGatewayAffinity). The shell SignalR settings are disabledSet cookie_based_affinity = "Disabled" and confirm in mgtapa that SignalR clients still connectCPE with Alya team
8No Internet port 80 ruleNSG allows Internet on 80. No HTTP listener existsRemove the rule. Same item as Front Door gap 14CPE
9No unused AzureSignalR inbound ruleNSG has an AzureSignalR inbound ruleVerify whether SignalR upstream calls exist. Remove the rule if notCPE with Alya team
10No unused private frontend IPA static private IP (.4 of the subnet) is allocated and no listener binds itRemove it in IaC unless a consumer is found. Check the plan does not recreate the gatewayCPE
11Dedicated gateway identity with Key Vault Secrets User scoped to the certificateThe platform-wide identity id-ion-<env>-chn-01 is usedCreate a dedicated user-assigned identity, grant the scoped role, and switch the module inputCPE
12No pinned certificate version or trusted-root inputsThe module still takes a version-pinned certificate secret ID and a trusted-root list. No listener or backend uses them. Their last consumer was removed with the service it servedRemove both inputs and their data sources from the stack and the moduleCPE
13Legacy listeners removedYammer listener, pool, settings, probe, rule (priority 81), and A record remainRemove them with the Yammer retirement ticketCPE
14Specific rule before catch-allgateway-rule (host-less) has priority 100, and default-api-gateway-rule (agw-api) has 110Verify the effective order. Give agw-api the lower numberCPE
15Unique rewrite rule sequencesThe AllowOrigin, AllowRoadieOrigin, and AllowAlyaPortalOrigin rules share sequence 100Verify the effective result. Give each rule a unique sequenceCPE
16CORS credentials only with a matched origin. Accurate allowed headersAllowCredentials is a fixed true. AllowHeaders is marked # TODO: FIXCondition the credentials header on the matched origin. Trim and fix the headers listCPE with frontend teams
17Rewrite parity with Front DoorNo parity check. Rewrites are hand-maintained in two placesAdd the parity item to the PR template. Long term, generate both from one mapCPE
18Rewrite rules apply every condition and headerModule dynamic blocks read only the first condition and first header configuration ([0])Fix the module so each rule applies all of its entries. Check existing rules before and afterCPE
19Regression suite covers every listenerNo coverage for portal shell, portal core, lobotomy, docs site, or the SignalR hostnames. Tests accept 401 and 403. No prd runExtend the suiteCPE
20Pinned module sourceLocal relative path. The JFrog v4.0.0 source is commented outPublish the current module and pin the stack to itCPE
21Front Door-only enforcement per listenerNot enforced. NSG allows Internet on 443 and the service tag covers every Front Door profileTarget-state WAF custom rule (security)CPE
22WAF on exception listenersNo WAFTarget state, phase 1 and 2 (security)CPE with security
23No bearer tokens in access logsFlagged risk. The SignalR access_token query parameter is recorded in the access logs of the SignalR hostnamesKeep the token short-lived and user-scoped, restrict read access to the workspace, and do not copy raw access logs into tickets. Evaluate a log transformation that strips the query string for these hostnamesCPE with Alya team
24Docs-site listener matches the hostingThe docs site is hosted on GitHub Pages, deployed by Terraform. Terraform still routes agw-docsite-webapp to the legacy func-doc-<env>-we-01 App ServiceRemove the legacy agw-docsite-webapp listener, pool, rule, and A record. Align the Front Door docs route with GitHub PagesCPE
25Rewrite parity with Front Door for the Shell SignalR negotiate pathThe Alya bypass rewrite set (data-alya-shell-fe.tf) has alya-sigr-v1-rewrite but no v2/signalr rule, so negotiate fails during a Front Door outage bypassAdd a rule that rewrites v2/signalr to /assgr-ext/v2/signalr. Same item as RT-03CPE
Not a gap

The gateway holds no data, so there is no backup or restore step. Recovery is a redeploy from IaC. Diagnostic settings are applied by Azure Policy, so the stack does not define them.

Add a listener and backend

These steps add a frontend agw-<app>-webapp that serves a SPA and rewrites its API prefix to APIM. The Front Door side is in add a frontend to Front Door.

1

Create the per-app file

Owner: Service team

Create data-<app>-fe.tf with one locals block. Start from an existing file such as data-service-management-fe.tf. Use the target probe values from the guidelines.

locals {
  imfe_webapp_endpoint = "web-imfe-${local.spoke_environment}-chn-01.azurewebsites.net"

  imfe_webapp_http_listener = {
    name                 = "imfe-webapp-http-listener"
    host_names           = ["agw-imfe-webapp.${var.rome_domain}"]
    ssl_certificate_name = var.default_ssl_certificate
    protocol             = "Https"
  }

  imfe_webapp_backend_pool = {
    name  = "imfe-webapp-backendpool"
    fqdns = [local.imfe_webapp_endpoint]
  }

  imfe_webapp_health_probe = {
    name                 = "imfe-webapp-health-probe"
    host                 = local.imfe_webapp_endpoint
    interval             = 15
    timeout              = 5
    unhealthy_threshold  = 3
    path                 = "/"
    protocol             = "Https"
    expected_status_code = ["200-399"]
  }

  imfe_webapp_backend_http_settings = {
    name                  = "imfe-webapp-backend-httpsettings"
    cookie_based_affinity = "Disabled"
    host_name             = local.imfe_webapp_endpoint
    port                  = 443
    protocol              = "Https"
    request_timeout       = 30
    probe_name            = local.imfe_webapp_health_probe.name
  }
}
2

Add the header rewrite set

Owner: Service team

Add a basic rewrite set that adds the security headers only when X-Azure-FDID does not match the ION profile, with negate = true. Read the profile ID from data.azurerm_cdn_frontdoor_profile.rome.resource_guid. If the app is a Module Federation remote, add a CORS rule for the Alya shell origin at the end of the set (sequence 900), so it applies after other rewrites.

3

Add the path map and the API rewrite

Owner: Service team

Add the URL path map. Order matters: the most specific path rule comes first. The default pool and settings point at the APIM pool.

imfe_url_path_map = {
  name                               = "imfe-url-path-map"
  default_backend_address_pool_name  = "gateway-pool"
  default_backend_http_settings_name = "gateway-settings"
  path_rules = [
    {
      name                       = "imfe-mfe-api-path-rule"
      paths                      = ["/api/*"]
      backend_address_pool_name  = "gateway-pool"
      backend_http_settings_name = "gateway-settings"
      rewrite_rule_set_name      = local.gateway_imfe_mfe_api_rewrite_ruleset.name
    },
    {
      name                       = "imfe-mfe-webapp-path-rule"
      paths                      = ["/*"]
      backend_address_pool_name  = local.imfe_webapp_backend_pool.name
      backend_http_settings_name = local.imfe_webapp_backend_http_settings.name
      rewrite_rule_set_name      = local.imfe_webapp_rewrite_rule_set.name
    }
  ]
}

The API rewrite set maps each public /api/... prefix to the APIM API path. It must be the same mapping as the Front Door route. For attachments or other blob paths, add a separate path rule on the blob pool, with a rewrite that strips the prefix.

4

Register the objects

Owner: Service team

In application_gateway.tf, add each local to its list:

LocalList
Listenerhttp_listeners
Backend poolbackend_address_pool_fqdns
Backend settingsbackend_http_settings_trusted_cas
Probeprobes
Header rewrite setbasic_rewrite_rule_sets
API rewrite setspath_rewrite_rule_sets
Path mapurl_path_maps

Then add the routing rule to request_routing_rules_rewrite_path_maps:

{
  priority           = 97 # unique, lower than the host-less catch-all
  name               = "imfe-webapp-routing-rule"
  rule_type          = "PathBasedRouting"
  http_listener_name = local.imfe_webapp_http_listener.name
  url_path_map_name  = local.imfe_url_path_map.name
},
5

Add the DNS record

Owner: Service team

In dns.tf, add the A record that points to the gateway public IP:

resource "azurerm_dns_a_record" "agw-imfe-webapp" {
  name                = "agw-imfe-webapp"
  zone_name           = var.rome_domain
  resource_group_name = "rg-rome-${var.environment_short}-chn-01"
  ttl                 = 300
  records             = [data.azurerm_public_ip.agw.ip_address]
}
6

Restrict the backend

Owner: Service team

Restrict the SPA host to the gateway subnet (agwsbn), ION’s Front Door for the priority-2 path, engineers through ZPA, and deployment runners. See lock down a priority-2 origin.

7

Add the regression test route

Owner: Service team

Add the listener to hub-test-suite/agw_routes.yaml for each environment: one entry for / and one for each API prefix. The same PR MUST add it.

8

Register identity and CORS

Owner: Service team

Add https://agw-<app>-webapp.<domain> as an Entra redirect URI and as an APIM CORS origin. This makes the portal bypass-capable for a Front Door outage.

9

Open a PR and promote

Owner: Service team and CPE

Open the PR with the plan output and the Front Door parity item checked. CPE deploys through Runway in mgtapa, then mgtbta, then mgtgma, then mgtprd. Run the regression suite after each deployment.

Tighten the probes

Change the values in each *_health_probe local and in the inline probes in application_gateway.tf:

interval            = 15 # 10 to 15
timeout             = 5  # 5 to 10, always below the interval
unhealthy_threshold = 3  # 2 or 3

Keep each probe path as it is. APIM already uses /status-0123456789abcdef, SignalR uses /api/health, and the SPAs use /. Roll the change out in mgtapa first, watch UnhealthyHostCount for a day, and then promote. A timeout that is too low can mark a slow but healthy host unhealthy, so check the backend response time in Log Analytics before the change.

Add the metric alerts

Add the alerts to alert.tf, routed to the existing CPE action group (data.azurerm_monitor_action_group.cpe_ag). var.agw_max_capacity is the variable added by gap 2. Two examples:

resource "azurerm_monitor_metric_alert" "agw_unhealthy_hosts" {
  name                = "alert-agw-${var.environment_short}-unhealthy-hosts"
  resource_group_name = "rg-rome-${var.environment_short}-chn-01"
  scopes              = [module.rome-agw.application_gateway_id]
  severity            = 2
  frequency           = "PT1M"
  window_size         = "PT5M"

  criteria {
    metric_namespace = "Microsoft.Network/applicationGateways"
    metric_name      = "UnhealthyHostCount"
    aggregation      = "Average"
    operator         = "GreaterThan"
    threshold        = 0
  }

  action {
    action_group_id = data.azurerm_monitor_action_group.cpe_ag.id
  }
}

resource "azurerm_monitor_metric_alert" "agw_capacity_units" {
  name                = "alert-agw-${var.environment_short}-capacity-units"
  resource_group_name = "rg-rome-${var.environment_short}-chn-01"
  scopes              = [module.rome-agw.application_gateway_id]
  severity            = 2
  frequency           = "PT5M"
  window_size         = "PT15M"

  criteria {
    metric_namespace = "Microsoft.Network/applicationGateways"
    metric_name      = "CapacityUnits"
    aggregation      = "Average"
    operator         = "GreaterThan"
    threshold        = var.agw_max_capacity * 0.8
  }

  action {
    action_group_id = data.azurerm_monitor_action_group.cpe_ag.id
  }
}

Add the same pattern for FailedRequests, BackendConnectTime, and BackendResponseStatus (dimension HttpStatusGroup equal to 5xx). Use Resource Health for platform incidents by setting health_alert_for_resources_enabled to true in every environment. The certificate near-expiry alert is on the Key Vault that holds the certificate, not on the gateway.

Run the regression suite

The suite is the post-deployment gate for each environment. It needs Python 3.14 or later and uv.

cd rome-ion/infrastructure/hub/hub-test-suite
uv run python main.py --infra agw --env apa   # then bta, then gma
  • Environment keys in agw_routes.yaml are apa, bta, and gma.
  • Tokens come from environment variables named ION_INFRA_<NAME>_TOKEN, for example ION_INFRA_ALYA_TOKEN.
  • The suite writes an HTML report with status, latency, and TLS certificate expiry for each route.
  • API routes accept 401 and 403, so they prove routing and rewrites, not authorization.

Extend the regression suite

Close gap 19 by adding these checks:

  1. Add listeners for portal shell, portal core, and lobotomy. Do not add the docs site: its listener is legacy and is removed under gap 24.
  2. Add a WebSocket reachability check for agw-alya-sigr and agw-alya-shell-sigr.
  3. Add a header check: with no X-Azure-FDID, the response carries the security headers. With the ION profile ID, it does not.
  4. Add a CORS check that a disallowed origin gets no Access-Control-Allow-Origin.
  5. Add a prd section that runs read-only checks after a production deployment.

Diagnose a gateway failure

  • Use the Log Analytics access log for the gateway and filter by host and status.
  • For a failed deployment, compare the plan output with the last known good state, and revert the PR rather than editing in the portal.
  • If Front Door is the source of the failure, use the bypass runbook.

Related pages

  • Architecture
  • Resiliency
  • Security
  • Guidelines
  • Front Door implementation
  • Data protection: Application Gateway

On this page

  • Repository layout
  • Current configuration
  • Add a listener and backend
  • Tighten the probes
  • Add the metric alerts
  • Run the regression suite
  • Extend the regression suite
  • Diagnose a gateway failure
  • Related pages
PreviousAzure Application Gateway guidelines
NextAzure Application Gateway resiliency
Edit on GitHubSecurity