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. Application resilience patterns

Application resilience patterns

reliability
architecturev3

Application resilience patterns

This page is the ION standard for self-preservation inside a service. It covers how a service handles transient faults, bad messages, duplicates, overload, and dependency failures without losing work or taking other services down with it. It also records how closely today’s services follow that standard.

Infrastructure recovery (zone loss, restore, failover) is covered by disaster recovery. Degraded-mode behavior and the generic rules for timeouts, backoff, and circuit breakers are covered by the graceful degradation guidelines. This page does not repeat them. It applies them to the ION runtime: Azure Functions, Service Bus, Cosmos DB, and webhooks.

How this page was built

The patterns below are taken from the code and Terraform of three services that cover the main ION workload shapes. Every observation is labelled with its confidence.

  • Verified: read directly in the service’s code, host.json, or Terraform.
  • Inferred: the behavior lives in the shared Ontinue.Ion.* libraries (IonHttpPolicy, AddIonCosmosClient, AddIonHttpClient, CosmosEventStoreRepository, ServiceBusDlqCountMetricService). These libraries are not in the service repositories, so their exact values have not been checked.

Services surveyed

ServiceRoleTierHosting (prd)
boundedctx-incidentsIncidents event store: commands, events, projections, replayT0Two Linux Consumption (Y1) Function Apps, messaging (app_scale_limit 25) and HTTP (app_scale_limit 5)
PigeonEscalation and customer notifications: email, Teams, voice (Twilio)T0P0v3 App Service plan, always_on, 2 workers
PhoenixMicrosoft Graph subscriptions for Teams messages, forwarded to PigeonT1, through FL-05 in the flow catalogueConsumption Function App, app_scale_limit 6

All three run .NET 10 on the Azure Functions v4 isolated worker, use the shared sbus-rome-* Service Bus namespace (ADR-0008), and send telemetry to Application Insights with sampling disabled. None of them uses Durable Functions or Temporal. SOC automation, which runs on Temporal, is covered only for its per-customer flood protection, in section 7.

Mapping to the reliability requirements

The V3 requirements set four application-level reliability requirements. This table shows which patterns satisfy each one and how far ION gets today.

RequirementPatterns on this pageStatus today
REL-1 Detect and notify processing failures and unavailable dependencies within 60 secondsDetection and alerting, health endpointsPartial. Telemetry is complete, but DLQ alerts cover few entities, and the one Incidents DLQ alert uses a 15-minute window. See RES-06 and RES-13
REL-2 Reject or dead-letter invalid messages without crashing or blocking unrelated workClassify failures, redelivery and dead-letteringMostly met. Schema validation and dead-lettering are in place. Phoenix retries invalid messages until they dead-letter (RES-09)
REL-3 Continue in a controlled degraded mode when a dependency is unavailableBack-pressure, kill switches, webhooksPartial. Service Bus buffers work during outages. There are no circuit breakers and no notification channel fallback (RES-17, RES-18)
REL-4 Make retries safe through idempotency, deduplication, and orderingIdempotency, orderingPartial. The event store is strong. The commands topic has no duplicate detection, Pigeon’s outbound sends have no idempotency key, and Phoenix has a constant MessageId fallback (RES-04, RES-05, RES-10)

The message lifecycle

Most ION work arrives as a Service Bus message. Every handler follows the same lifecycle. The patterns below describe each step.

There is one path the lifecycle does not have: catch the exception, log it, and complete the message. That path loses work silently. It is the most serious gap found in the survey (RES-01, RES-02).

The ION standard

1. Classify every failure

  • Handlers MUST classify each failure as one of three kinds and handle it as follows.

    KindExamplesHandling
    TransientTimeouts, 429, 5xx, Service Bus or Cosmos DB ServiceUnavailableThrow, so that Service Bus redelivers the message
    Permanent (poison)Schema violation, bad signature, unknown aggregateDead-letter at once with a reason and description. Do not retry
    Business ruleInvalid state transition, rejected commandPublish a failed event so the caller learns the outcome, then complete
  • Handlers MUST NOT catch all exceptions and complete the message. A catch-all is allowed only if it dead-letters the message or publishes a failure event, and records telemetry that an alert can fire on.

  • Timer and change-feed functions have no dead-letter queue. A permanent failure there MUST emit an alertable telemetry event, and a transient failure MUST throw so that the function retry policy applies.

Reference implementations (Verified):

  • boundedctx-incidents: CommandHandlerServiceBase turns a business-rule failure into a failed.v1 outbound event instead of a dead-letter.
  • Phoenix: timer functions separate RetryableException (retried) from PersistentException (not retried).
  • boundedctx-incidents: events of an unknown type are logged and completed. This is allowed on shared topics for forward compatibility, because the consumer is not the owner of that event type.

2. Retry transient faults

There are three retry layers. They do different jobs, and a service needs all three.

LayerWhat it retriesION standard
Service Bus client (host.json clientRetryOptions)SDK operations: connect, receive, complete, publish. Not handler failuresExponential, delay 5 s, maxDelay 1 min, maxRetries 5, tryTimeout 60 s
Service Bus redeliveryHandler failures. Redelivery is immediate; it is not backoffmax_delivery_count per section 3
Outbound dependency clientHTTP calls to Graph, Twilio, Signet, and other APIsShared IonHttpPolicy or the SDK’s own retry handler, honouring Retry-After
  • Every Function App that uses Service Bus MUST set clientRetryOptions in host.json to the ION standard above.
  • Outbound HTTP clients MUST be created through IHttpClientFactory with a bounded, jittered retry that honours Retry-After on 429 and 503, and an explicit timeout. The graceful degradation guidelines set the general rules.
  • Microsoft Graph clients MUST keep the Graph SDK retry handler in the middleware pipeline, or provide an equivalent.
  • A handler that needs a delay before retrying SHOULD schedule a new message (ScheduledEnqueueTime) and complete the current one, rather than relying on immediate redelivery. Pigeon’s voice campaign retry (3 attempts, 30 s apart) is the reference.
  • Function-level retry attributes (ExponentialBackoffRetry, FixedDelayRetry) are supported only for timer, Cosmos DB, Event Hubs, and Kafka triggers. Services MUST NOT rely on them for Service Bus triggers.
  • The total retry time of all layers MUST fit inside the message lock duration (with auto-renewal) and the functionTimeout.

Observed:

  • boundedctx-incidents and Phoenix set clientRetryOptions to the standard (Verified). Pigeon does not set it and runs on SDK defaults (Verified).
  • Phoenix timers use ExponentialBackoffRetry(3, "00:00:02", "00:08:00") (Verified).
  • Pigeon classifies Twilio 408, 429, 500, 502, and 503 as transient (Verified).
  • Pigeon’s Graph and Teams client (GraphClient.cs) converts every exception to a Failed result, with no retry and no 429 handling (Verified). RES-03.
  • IonHttpPolicy retry counts and backoff values (Inferred). The JWT client uses a 3-second timeout (Verified).

3. Redelivery and dead-lettering

  • max_delivery_count MUST be set explicitly in Terraform for every subscription and queue.

    Entity typemax_delivery_countWhy
    Commands, events, projections3Fails fast to the DLQ. With sessions, a poison message blocks its workspace session until it is dead-lettered
    Replay, purge, forwarding bridges10Long-running maintenance work that tolerates more transient failures
  • Dead-lettering on message expiration MUST be on, as the DR guidelines require.

  • Message TTL on T0 entities in prd MUST be longer than the T0 RTO of 4 hours. ION uses P7D in prd.

  • Every subscription and queue MUST have a dead-letter alert: dead-lettered count greater than 0, routed to the owner team and SRE. The DlqMonitorFunc in each service publishes the dead-letter counts as a custom metric (Inferred: the logic is in ServiceBusDlqCountMetricService); the alert must be defined on top of it or on the Service Bus metric.

  • Dead-lettered messages are resubmitted with the procedure on the Service Bus DR page.

Observed (Verified):

  • boundedctx-incidents: 3 on commands, events, and projections; 10 on replay, purge, and the bridge. TTL P7D in prd.
  • Pigeon: 3, and 10 on the bridge. TTL PT4H in alpha and beta, P3D in gamma, P7D in prd.
  • Phoenix: the onboarded-subscription entity uses 5 with TTL P7D. The notification queues leave max_delivery_count at the Azure default and use a 30-minute TTL with dead-lettering on expiry.
  • Dead-letter alerts: boundedctx-incidents has one (on the external commands subscription, with a probable dimension defect), Pigeon covers 2 of about 8 entities, and Phoenix has none. The shared tf-alerts Service Bus module is generic: each service passes the metric, such as DeadletteredMessages, and the entities to watch, so coverage depends on each service’s instantiation. RES-06.

4. Idempotency and duplicate detection

Service Bus delivers at least once. Every handler sees duplicates eventually.

  • Every handler MUST be idempotent, as the Service Bus DR rules already require.
  • Publishers MUST set MessageId to a value derived from the business identity of the message: the event ID, the command ID, or the provider’s notification ID. They MUST NOT use a constant fallback.
  • Topics and queues that receive commands or external input SHOULD enable duplicate detection. The ION window is PT5M, and PT10M for customer contact ingestion. Duplicate detection cannot be switched on for an existing entity: the entity must be recreated, with a migration plan for messages in flight.
  • Event-store appends MUST use optimistic concurrency on the expected stream version.
  • Projections MUST be idempotent on the event’s identity or version, for example by comparing an etag or by using MERGE or IF NOT EXISTS.
  • Side effects that reach people (email, Teams, voice) MUST record an idempotency key before or atomically with the send, so that a redelivered message does not notify a customer twice.

Reference implementations (Verified):

  • boundedctx-incidents appends with AppendToStreamAsync(key, aggregate.Version) and rejects a stale version.
  • boundedctx-incidents SQL projections compare a UUIDv7 event_store_etag (UPDATE … WHERE event_store_etag <> @etag) and use IF NOT EXISTS and MERGE.
  • Pigeon uses Redis GetOrSetAsync with a 60-second TTL to deduplicate comment and use-case IDs, deduplicates action cards by request ID, and treats a Table Storage 409 as “already done”. The key SHOULD live at least as long as the message can be redelivered; 60 seconds is too short (RES-10).
  • Duplicate detection is on for IntIncidentStore and IntEventProcess (PT5M), ExtOutgoingEvents (PT1M), and Pigeon’s IntCustomerContactIngestion (PT10M) and IntEventIngestion (PT5M).

Gaps: the ExtIncidentStore commands topic has no duplicate detection (RES-04). Phoenix falls back to new Guid().ToString(), which is the all-zeros GUID, and its queues have no duplicate detection (RES-05). Pigeon’s deduplication window is too short, and escalation and voice sends have no idempotency key (RES-10).

5. Ordering and concurrency control

  • When the order of messages matters, the entity MUST use sessions keyed on the ordering scope. ION keys sessions on the workspace ID. maxConcurrentSessions then bounds parallelism across workspaces.
  • Where per-field order cannot be guaranteed, handlers SHOULD compare field-level timestamps and keep the newest value, as the Incidents projections do.
  • Writes to a shared document SHOULD use optimistic concurrency (an ETag match). Last-writer-wins is allowed only where the document has a single writer, and the page for that service must say so.
  • Create operations SHOULD be atomic (create-if-not-exists), not check-then-create.

Observed (Verified): boundedctx-incidents uses workspace sessions with support_ordering, Cosmos DB partition /partition_id, stream key {workspace}_{incident}, and field-level timestamps. Pigeon uses SessionId = WorkspaceId but writes with ETag.All. Phoenix upserts with no etag and onboards with check-then-create (RES-12).

6. Timeouts and execution budgets

  • functionTimeout SHOULD be explicit in host.json. The Consumption default is 5 minutes; the dedicated-plan default is 30 minutes.
  • Long operations MUST carry a budget below the host limit and return a continuation when the budget runs out.
  • Every outbound call MUST have a timeout shorter than the caller’s own budget.
  • The Service Bus lock, including auto-renewal, MUST outlast the handler’s worst-case duration, or the message is redelivered while it is still being processed.

Reference implementations (Verified):

ServiceBudgetLimit it protects
boundedctx-incidentsPurge SQL commandTimeout 240 s5-minute Consumption default
PigeonPurge CancellationTokenSource of 200 s, returning 408 with HasMoreData so the caller continues230-second HTTP request limit of the front end
PigeonTwilio ring timeout 60 s, gather timeout 20 sVoice call duration
PhoenixfunctionTimeout 5 minutesExplicit

7. Concurrency limits and back-pressure

Scale-out protects the service but can overwhelm what is behind it. Limits keep the downstream stores and APIs inside their capacity.

  • Every Function App MUST set app_scale_limit (or the plan’s instance limit) to a value the downstream stores can absorb.
  • Service Bus handlers SHOULD set maxConcurrentSessions or maxConcurrentCalls explicitly, sized against Cosmos DB RU and SQL DTU or vCore capacity.
  • HTTP-heavy Function Apps SHOULD set maxConcurrentRequests, maxOutstandingRequests, and dynamicThrottlesEnabled, so that overload becomes a 429 instead of a crash.
  • Public APIs MUST have an APIM rate limit.
  • Bulk maintenance (purge, replay) MUST be paced.

Observed (Verified):

Controlboundedctx-incidentsPigeonPhoenix
Instance limit25 messaging, 5 HTTP2 workers6
Service Bus concurrencymaxConcurrentSessions 48, maxConcurrentCalls 3, prefetchCount 150DefaultsmaxMessageBatchSize 25
HTTP throttlesDefaultsDefaultsmaxConcurrentRequests 30, maxOutstandingRequests 200, dynamic throttles on
Host health monitor1-minute window, threshold 10, counterThreshold 0.85Defaults10-second interval, 2-minute window, threshold 6, counterThreshold 0.8
APIM rate limitPer API300 calls per 60 s; Twilio webhooks 100 per 60 sNot applicable
Bulk pacingPurge: 250 ms between partition deletes, SQL batches of 2,000Purge budget (section 6)Not applicable

No service uses a circuit breaker (RES-17).

Per-customer isolation in the incident pipeline

The limits above protect the platform as a whole. They do not, on their own, stop one customer’s burst from delaying the others. Two controls do that.

  • Per-customer session lanes. Sessions are keyed on the Sentinel workspace ID, which is one per customer (section 5). A session is processed by one handler at a time, and maxConcurrentSessions spreads handlers across workspaces. A burst from one customer therefore queues up in that customer’s own lane instead of using every handler. Conveyor publishes incident actions with SessionId = WorkspaceId (ServiceBusIncidentActionsClient.cs, Verified).
  • Flood protection in SOC automation (FLD-001). Lanes stop a burst from using every handler, but each incident in the burst still gets a full automation run, with its enrichment calls and Microsoft API quota. FLD-001 groups near-identical incidents from one customer under a single parent incident, so automation runs once for the whole burst.

Observed (Verified): Conveyor’s throttle-v2 stage does not throttle. It republishes every message as INCIDENT_NOT_THROTTLED, the Throttling:* App Configuration keys are never read, and the Execute_Throttled flag is never used (RES-23). Archer’s CacheThrottleAsync limits Sentinel writes per incident, not per customer, behind the ENABLE_KRO_2711 flag. Neither is a per-customer control.

Flood protection in SOC automation (FLD-001)

  • SOC automation MUST cap bursts of near-identical incidents per customer, so that one customer’s flood cannot cause automation outages, timeouts, or Microsoft API rate limiting for everyone.
  • The flood guard MUST run in the first rank of the automation plan, and it MUST be dispatched by a configuration-engine rule with execution_policy: barrier. Otherwise its stop directive is logged and ignored.
  • The flood guard MUST fail open. If it cannot verify flood state, the incident gets normal automation.

Why it exists. On 15 January 2026, one customer received more than 2,000 incidents with the alert “A potentially malicious URL click was detected” in a short period. Most had one matching entity. Microsoft did not group the alerts into one incident of about 150 alerts; it created more than 2,000 incidents of 1 to 5 alerts each. The SOC could not prioritise them by hand, and SOC automation went down.

Status (Verified): deployed in production. The workflow is fld-001-flood-guard, in cerebro-content/app/soc-automation/src/libs/workflows/flooding/. Its configuration is workflows/config/flooding_config.json. The shared counter and state are in ziege/libs/ontinue-ziege-automation/src/ontinue/ziege/automation/ (flood_counter.py, flood_state.py). The barrier rule is configuration-engine data, not code. The stop directive is honoured in ziege/app/incident-manager/src/libs/workflows/plan_execution.py (_authorized_stop). Delivered under NYX-2044, with the barrier policy under NYX-2010.

How it works.

  1. Scope. The workflow builds one or more scopes for each incident from its alerts: the workspace (customer) plus the alert dimensions configured in a rule. Today every rule uses alert_display_name.
  2. Count. It adds the incident ID once per scope to a Redis sorted set, ziege:flood-counter:v1:{workspace}:{fingerprint}, and keeps members for twice the window. It counts incidents, not alerts.
  3. Claim. If the count in the window is above the rule’s threshold, it claims the flood atomically with a Lua script (ziege:flood:v1:...). The incident that crosses the threshold becomes the parent and gets normal automation.
  4. Suppress. While the flood state is active, every later matching incident from that customer is a child. The workflow returns the decision force-close with the closure comment "Handled in incident {parent}". It posts a public comment on the child that points to the parent, and one on the parent that points to the child. It then returns ExecutionControl(directive="stop"), so later ranks are skipped.
  5. End. The flood ends only when its state expires after the TTL. Nothing renews or releases it. If the burst continues, the next incident over the threshold becomes a new parent, roughly once per TTL.

Configuration in production (Verified):

RuleTypeMatchesFlood starts whenWindowTTL
eppSpecificalert_display_name starts with “Email reported by user as malware or”More than 50 incidents30 minutes30 minutes
fallback-alert-nameFallbackEach alert name that no specific rule claimsMore than 100 incidents30 minutes30 minutes

A fallback rule sees only the alerts that no specific rule claimed. If the configuration cannot be read, the built-in default applies: dimensions product_name and alert_type, more than 100 incidents, 30-minute window and TTL.

Design decision: incidents with mixed alerts are suppressed too. A child incident that also contains alerts of other types is still force-closed. This is intended. The parent incident is investigated in full, and the flood handling covers the further alerts and incidents from the same attack or false-positive scenario. The original requirement excluded mixed incidents; that exclusion was dropped on purpose.

Observability. The workflow logs flood_started and flood_child_suppressed events with zge.flood.* fields. A Sentinel analytic rule in tangela alerts the SOC shifts once per flood. It was not located during this review.

Planned, not built:

  • Stop the SLA on child tickets instead of force-closing them. This depends on bulk close in Alya and on automation being able to stop an SLA.
  • Re-run automation in bulk on the children once the flood is handled.
  • A configurable rank sequence, to replace the fixed first-rank placement.

8. Inbound webhooks

Providers such as Twilio and Microsoft Graph call ION back over HTTP. They retry on their own schedule, and Graph can disable a subscription whose endpoint keeps failing.

  • Webhooks MUST validate the origin at the edge (X-Azure-FDID) and the provider signature, at APIM and again in the application.
  • Webhooks MUST acknowledge quickly: publish to Service Bus, then return 2xx. All business work happens in a worker behind the queue.
  • The response code MUST match the retry semantics. Return 2xx only after the publish succeeds, 5xx only for transient failures you want the provider to retry, and 4xx for invalid requests that must not be retried.
  • The published MessageId MUST come from the provider’s event identity, so that provider retries are deduplicated.

Observed (Verified): Pigeon’s Twilio webhooks follow the pattern, apart from deduplication (RES-10). Phoenix returns 500 for every exception, so Graph also retries requests that can never succeed (RES-08).

9. Health endpoints

  • Every Function App MUST expose a health endpoint that checks its critical dependencies and reports optional ones as Degraded, not Unhealthy.
  • health_check_path in Terraform MUST equal the route prefix plus the function route. With the default routePrefix of api, a function route of v1/health is served at api/v1/health.
  • Health checks for a dependency client MUST be registered, or the endpoint reports healthy while the dependency is down.

Reference implementation (Verified): Pigeon’s v1/health checks Service Bus, Key Vault, and the Conveyor queue (as Degraded), and its Terraform path api/v1/health matches.

Gaps (Verified): boundedctx-incidents serves api/v1/healthcheck, but Terraform sets api/healthcheck. Phoenix serves api/v1/health, but Terraform sets /v1/health. Phoenix’s GraphApiClient health check is not registered. RES-07.

Platform health check and the Consumption plan

The App Service health check, which removes unhealthy instances, acts on dedicated and Premium plans. On the Consumption plan it has little or no effect (Inferred). A wrong path is therefore silent today, but it would take every instance out of rotation after a move to a dedicated or Flex Consumption plan. The endpoints are still useful for synthetic monitoring.

10. Kill switches and degraded mode

  • Behavior that can be shed under pressure MUST sit behind an Azure App Configuration feature flag, and be registered with the platform degraded-mode control described in the graceful degradation guidelines.
  • Scheduled or automated state changes on T0 flows SHOULD have a kill switch.

Observed (Verified): boundedctx-incidents uses EnableKro* flags and has a kill switch for scheduled state transitions. Phoenix has feature management wired in but evaluates no flags (RES-20). Pigeon has no channel fallback, for example from Teams to email, when a channel is down (RES-18).

11. Recovery tooling

  • Every T0 service MUST have a documented way to rebuild its outputs: a replay command, a resubmit path, or a reconciliation tool.
  • Destructive tooling MUST be paced and idempotent.

Reference implementation (Verified): boundedctx-incidents has Replay, ReplayStream, and Purge commands and the IncidentSync tool. The replay procedures describe how they are used. The SQL projections for alerts and entities intentionally run without a transaction and rely on replay for repair; comment and rating projections use transactions.

12. Safe deployment

  • Function Apps SHOULD deploy to a deploy slot and swap.
  • Slot-specific settings MUST be sticky. Timer triggers MUST be disabled in the slot, and the slot MUST consume from its own -deployslot subscriptions, so that a warming slot never takes production messages.

Observed (Verified): all three services follow this pattern.

13. Detection and alerting

  • Every service MUST send traces, structured logs, and dependency telemetry to Application Insights, as the shared libraries do today.
  • Every T0 service MUST alert on: dead-lettered messages, function failure rate, and the lag of any change-feed or timer pipeline it owns.
  • To meet REL-1, alert evaluation SHOULD use a frequency and window of 1 minute on T0 failure signals.
  • Alert Terraform MUST be checked in the plan review. A typo in a variable name, a wrong metric, or a duplicated rule key silently removes coverage.

Observed (Verified):

  • boundedctx-incidents: one DLQ alert (Sev0, more than 0, 15-minute window). The SQL “CPU” rule uses storage_percent, the rule_2 key is duplicated, and the variable servicbus_alerts_enabled is misspelled. There are no function-failure or change-feed lag alerts. RES-13.
  • Pigeon: DLQ and active-message (more than 300) Sev0 alerts on 2 entities.
  • Phoenix: no DLQ alert. Its two log alerts are disabled in every environment and mislabelled.
  • Every service instantiates the shared tf-alerts modules from the module registry in its own infrastructure. The owning teams report alerts deployed for almost all services. The reliability maturity model assesses this coverage.

Observed implementation matrix

Patternboundedctx-incidentsPigeonPhoenix
1. Failure classificationYes, failed-event pattern. Change feed swallows errors (RES-01)Partial. Escalation handler swallows errors (RES-02)Partial. PersistentException swallowed in timers, recreation swallows errors (RES-19)
2. Service Bus client retryStandardSDK defaults (RES-11)Standard
2. Outbound retryIonHttpPolicy (Inferred)Twilio yes, Graph no (RES-03)Polly through the Doppio client (Inferred)
3. max_delivery_count explicitYesYesPartial (RES-09)
3. DLQ alert on every entityNo (RES-06)No (RES-06)No (RES-06)
4. Deterministic MessageIdYes (Inferred, shared library)Yes on ingestionNo, zero-GUID fallback (RES-05)
4. Duplicate detectionYes, except commands topic (RES-04)Yes on ingestionNo (RES-05)
4. Idempotent handlersYes, version and etagPartial (RES-10)Partial
5. Sessions and orderingYesYesOnboarding only
5. Optimistic concurrencyYesNo (RES-12)No (RES-12)
6. Explicit timeouts and budgetsYesYesYes
7. Concurrency limitsYesDefaultsYes
8. Webhook patternNot applicableYes, apart from dedupNo (RES-08)
9. Health path correctNo (RES-07)YesNo (RES-07)
10. Kill switchesYesNoWired, unused (RES-20)
11. Recovery toolingYesPurge onlyNo
12. Slot deploymentYesYesYes
13. Failure alertsPartial (RES-13)PartialNo

Application failure catalogue

The catalogue lists failures that happen inside the application layer. The infrastructure failure modes are on the DR resource pages. Severity is the impact if the failure is not mitigated. Likelihood is for the current design.

ProblemRiskSourceSeverityLikelihoodMitigation
Transient Service Bus, Cosmos DB, or SQL error during handlingMessage redelivered up to max_delivery_count, then dead-letteredAzure platformMediumHighClient retry, redelivery, DLQ alert and resubmit
Poison or invalid messageRetries waste capacity. With sessions, the workspace is blocked until the message is dead-letteredBad publisher, schema driftHighMediumSchema and signature validation, immediate dead-letter, max_delivery_count 3
Duplicate deliveryDuplicate events, double notifications to customersAt-least-once delivery, provider retriesHighHighDeterministic MessageId, duplicate detection, idempotent handlers, send-side idempotency keys
Out-of-order deliveryAn older value overwrites a newer oneParallel publishersMediumMediumWorkspace sessions, field-level timestamps, version checks
Concurrent writes to one aggregate or documentLost updateScale-outHighMediumOptimistic concurrency on stream version or ETag
Downstream throttling (Cosmos DB 429, SQL DTU, Graph 429, Twilio 429)Retry storms, cascading failureDependency capacityHighMediumScale limits, concurrency caps, Retry-After, pacing. No circuit breakers yet (RES-17)
External dependency outage (Graph, Twilio)Notifications delayed or not sentExternal providerHighMediumService Bus buffering and redelivery to DLQ. No channel fallback yet (RES-18)
Exception swallowed and message completedSilent loss of work with no alertCode defectHighMediumClassification rules in section 1. RES-01, RES-02
Change-feed publish failureEvents stored but never published. Downstream state goes stale until a manual replayCode defect or Service Bus outageHighLowRethrow with a retry policy, lag alert, replay. RES-01
Handler runs past its lock or functionTimeoutDouble processing, abandoned workLong operationsMediumMediumExecution budgets and continuations, lock renewal
Webhook flood or forged callbackOverload or spoofed eventsExternalHighLowFront Door ID, signature validation, APIM rate limits
Incident flood from one customer: many near-identical incidents in minutesAutomation outage, timeouts, Microsoft API rate limits, SOC overload, other customers delayedUngrouped alerts at the source, internal phishing campaigns, noisy detectionsHighMediumPer-customer session lanes and FLD-001 flood protection (section 7). Fails open. RES-22
Webhook handler failsProvider retries pointlessly, or Graph drops the subscriptionCode defect, dependency outageMediumMediumQuick-ack, correct status codes. RES-08
Graph subscription removed, not renewed, or missed notificationsTeams messages missedExternal lifecycleMediumMediumLifecycle handling renews and recreates subscriptions, and timers retry. Recreation failures are swallowed. RES-19
Messages expire during a consumer outageQueued work lostOutage longer than TTLHighLowTTL P7D in prd, dead-lettering on expiry
Partial SQL projection writeRead model inconsistent until repairedBy design for alerts and entitiesLowLowEtag-idempotent projections and replay. Accepted
Faulty releaseError rate risesChangeHighMediumSlot deployment and swap back

Gap register

These gaps are between the standard above and the code or Terraform of the surveyed services. HIGH means work can be lost silently, or a T0 failure goes undetected. Each gap closes when the code or Terraform matches the standard.

IDSeverityServiceGapEvidenceTargetOwner
RES-01HIGHboundedctx-incidentsThe change-feed publisher catches every exception and only logs it. The lease checkpoint advances, so events are silently not published until someone replays themEventPublisherFunc.cs (Verified)Rethrow with a Cosmos DB trigger retry policy, and alert on publish failures and change-feed lagIncidents team
RES-02HIGHPigeonProcessEscalationInitiated catches every exception, so a failed escalation is completed and lostProcessEscalationInitiated.cs (Verified)Throw on transient failures. Dead-letter or publish a failed event on permanent onesPigeon team
RES-03HIGHPigeonGraph and Teams sends have no retry and no 429 handling. Every exception becomes a Failed resultGraphClient.cs (Verified)Graph SDK retry handler or IonHttpPolicy, honouring Retry-AfterPigeon team
RES-04HIGHboundedctx-incidentsThe ExtIncidentStore commands topic has no duplicate detectioninfrastructure-shared/main-svcbus.tf (Verified)Duplicate detection PT5M. The topic must be recreated, with a migration planIncidents team
RES-05HIGHPhoenixThe MessageId fallback is new Guid().ToString(), the all-zeros GUID. Outbound messages to Pigeon have no MessageId, and no queue has duplicate detectionResourceNotificationHandler.cs, LifecycleNotificationHandler.cs, TeamsChangeNotificationRecord.cs (Verified)A deterministic ID from the Graph notification, and duplicate detection on the queuesPhoenix team
RES-06HIGHAll threeDead-letter alerts cover few entities: one in boundedctx-incidents (with a probable dimension defect), 2 of about 8 in Pigeon, none in Phoenix. The shared Service Bus alert module only alerts on the entities each service passes to itService alert Terraform, tf-alerts/azure (Verified)A dead-letter alert on every subscription and queue, routed to the owner team and SREOwner teams, SRE
RES-07MEDIUMboundedctx-incidents, Phoenixhealth_check_path does not match the served route. Phoenix’s Graph health check is not registeredfunc-http.tf, func-messaging.tf, phoenix/infrastructure/main.tf, HealthCheckFunc.cs (Verified)Correct the paths and register the checkIncidents team, Phoenix team
RES-08MEDIUMPhoenixThe Graph webhook returns 500 for every exceptionExceptionHandlingMiddleware.cs (Verified)4xx for invalid input, quick-ack after enqueuePhoenix team
RES-09MEDIUMPhoenixInvalid messages are abandoned and retried until they dead-letter. Notification queues leave max_delivery_count at the defaultResourceNotificationProcessorFunc.cs, LifeCycleNotificationProcessorFunc.cs, queue Terraform (Verified)Dead-letter invalid messages at once with a reason. Set max_delivery_count explicitlyPhoenix team
RES-10MEDIUMPigeonDeduplication uses Redis keys that live only 60 seconds (CustomerContactService, MessageSyncService, CustomDetectionService). That is shorter than a redelivery after a lock expiry, so late duplicates get through. Escalation and voice sends have no idempotency key, and Twilio callbacks are not deduplicated by CallSidServices named in the gap (Verified)A send-side idempotency key that lives at least as long as the message TTL, in Redis or Table StoragePigeon team
RES-11LOWPigeonNo clientRetryOptions or concurrency settings in host.json. SDK defaults applyhost.json (Verified)The ION standard valuesPigeon team
RES-12MEDIUMPigeon, PhoenixLast-writer-wins writes (ETag.All, null original ETag). Phoenix onboarding is check-then-createTableStorageClient.cs, DefaultSubscriptionService.cs (Verified)Optimistic concurrency and atomic create, or a recorded single-writer exceptionPigeon team, Phoenix team
RES-13MEDIUMboundedctx-incidentsAlert defects: SQL “CPU” rule on storage_percent, duplicated rule_2 key, misspelled servicbus_alerts_enabled. No function-failure or change-feed lag alert. DLQ window is 15 minutesAlert Terraform (Verified)Fix the rules, add the missing alerts, 1-minute evaluation on T0 signalsIncidents team
RES-14MEDIUMPhoenixA message that does not fit in an empty batch makes the send loop repeat until the function times outResourceNotificationHandler.cs, LifecycleNotificationHandler.cs (loop Verified, runtime behavior Inferred)Fail the oversize message explicitlyPhoenix team
RES-15LOWPigeonthrow; // TODO temp in the ingestion functions. Removing it would introduce a swallowIngestion functions (Verified)Keep the rethrow and remove the TODOPigeon team
RES-16LOWPigeonGraphServiceRequestHandler.Send calls RunSynchronously on a task that has already started, which throws. Only the synchronous Send path is affected, and the Graph SDK normally uses the asynchronous oneGraphServiceRequestHandler.cs (code Verified, reachability Inferred)Remove the synchronous override, or read the content synchronouslyPigeon team
RES-17MEDIUMAll threeNo circuit breakers on Graph, Twilio, or other external dependenciesCode (Verified)Circuit breakers per the graceful degradation guidelinesOwner teams
RES-18MEDIUMPigeonNo channel fallback when a notification channel is downCode (Verified)A documented fallback order for T0 escalationsPigeon team
RES-19MEDIUMPhoenixRecreating a subscription after subscriptionRemoved swallows every exception on purpose (KRO-1920) and logs only a warning. missed lifecycle events are only logged. Teams messages are missed until someone recreates the subscription through the admin APIDefaultSubscriptionService.cs, LifeCycleNotificationProcessor.cs (Verified)Let recreation failures throw so they retry and dead-letter, and alert on themPhoenix team
RES-20LOWPhoenixFeature management is wired, but no flag is evaluated, so there is no kill switchCode (Verified)A kill switch for subscription processingPhoenix team
RES-21LOWShared librariesRetry, timeout, and DLQ-metric defaults in the Ontinue.Ion.* libraries are not documentedNot in service repositoriesPublish the defaults so services can be verified against this standardShared-library owners
RES-22MEDIUMSOC automation (FLD-001)Every child upserts the parent’s comment with the same static ID (_FLOODPARENT_COMMENT_NAMESPACE), so the parent shows only the latest child, not the list of all childrenflood_guard.py _suppress (Verified)A comment ID per child, or one comment that appends every childVAL team
RES-23LOWConveyorthrottle-v2 is a pass-through. The Throttling:* App Configuration keys and the Execute_Throttled flag are never usedThrottleService.cs, ThrottleHandlerFunc.cs, Constants.cs, infrastructure-config/main-throttled.tf (Verified)Implement the throttle, or remove the dead configuration and the extra hopConveyor team

Applying the standard to other services

The three surveyed services are a sample. Every other ION service that uses Service Bus, Cosmos DB, or webhooks SHOULD check itself against the ION standard and the implementation matrix, and record its own gaps here with new RES-xx IDs.

Related pages

  • Graceful degradation guidelines
  • DR implementation: Service Bus
  • DR implementation: Function Apps
  • Event-store recovery
  • Replay
  • V3 requirements
  • Microsoft Learn: Azure Functions error handling and retries
  • Microsoft Learn: Service Bus duplicate detection

On this page

  • Services surveyed
  • Mapping to the reliability requirements
  • The message lifecycle
  • The ION standard
  • 1. Classify every failure
  • 2. Retry transient faults
  • 3. Redelivery and dead-lettering
  • 4. Idempotency and duplicate detection
  • 5. Ordering and concurrency control
  • 6. Timeouts and execution budgets
  • 7. Concurrency limits and back-pressure
  • 8. Inbound webhooks
  • 9. Health endpoints
  • 10. Kill switches and degraded mode
  • 11. Recovery tooling
  • 12. Safe deployment
  • 13. Detection and alerting
  • Observed implementation matrix
  • Application failure catalogue
  • Gap register
  • Applying the standard to other services
  • Related pages
PreviousV3 reliability
NextCritical flows
Edit on GitHubSecurity