Covers the mitigate-first principle, the main mitigation levers (deployment rollback and slot swap, feature flag kill switches, scaling out, regional failover, load shedding and rate limiting), how to choose a lever from 'what changed', and the risks of each.
Every minute of an outage costs customers, revenue and trust — for a busy checkout that can be thousands of dollars a minute — while the root cause can be found later from preserved telemetry. So responders ask "what changed?" and reach for the fastest, safest, reversible lever: roll back the release (an App Service slot swap or a previous container image), turn off the feature flag, scale out if it's genuinely capacity, fail over to Australia Southeast if a region is impaired, or shed load with rate limiting to protect the critical path.
Good mitigation is rehearsed (a rollback you've never practised is a new risk), done one change at a time and verified against the SLIs. The trade-off is speed versus evidence: grab the evidence first when it costs seconds (a memory dump, a log export, a note of the deploy id), because a restart or rollback can destroy what explains the cause — but never delay mitigation by minutes to do it.
"The reason to mitigate first is simple economics: customers are paying for every minute, and the root cause doesn't get any less findable if I restore service — as long as I keep the evidence. So the first question I ask is 'what changed?' Most incidents follow a change: a deploy, a configuration or feature-flag change, a traffic spike, or a dependency going bad. The answer points to the lever.
If a release went out in the last hour, I roll it back — on App Service that's swapping the staging slot back, on AKS it's
kubectl rollout undoor redeploying the previous image tag. If the change was a new feature behind a flag, I turn the flag off in Azure App Configuration, which takes effect in seconds without a deploy. If it's real capacity — CPU saturated, thread-pool queue growing with traffic — I scale out. If Australia East is impaired, I fail over to Southeast with Front Door or Traffic Manager. And if a dependency is drowning, I shed load: rate-limit the non-critical endpoints so checkout keeps working.For example, at [company] a release introduced an N+1 query on the orders page; p95 went from [200 ms] to [4 s]. We swapped the slot back in [3] minutes, and only then pulled the query from Application Insights to find the cause. The mistake I see is scaling out as a reflex: if the database is the bottleneck, ten more app instances just send ten times more queries at it. Mitigation is about picking the lever that matches the change — and changing one thing at a time so you know what worked."
| Lever | Use when | Time to effect | Risk |
|---|---|---|---|
| Rollback / slot swap | A deploy correlates with the start | 1–5 min | Schema changes that aren't backward-compatible |
| Feature flag off | A flagged feature is involved | Seconds (after config refresh) | Flag not covering the whole change |
| Config revert | A setting changed | Minutes | Secrets and config caches |
| Scale out / up | Genuine saturation from traffic | Minutes (instances warm up) | Amplifies load on a failing dependency |
| Restart instances | Leak or stuck state, no recent change | Minutes | Destroys evidence; problem returns |
| Regional failover | Region or zone impaired | Minutes (DNS/Front Door) | Data replication lag, capacity in the secondary |
| Load shedding / rate limit | Overload threatens everything | Seconds to minutes | Some users get 429/503 |
| Block bad traffic | Abuse, bot, a single bad client | Minutes (WAF rule) | Blocking legitimate users |
| Signal | Likely lever |
|---|---|
| Started within minutes of a deploy | Rollback |
| Started when a flag/config changed | Revert flag/config |
| Traffic doubled, resources saturated | Scale out, shed load |
| Dependency errors (SQL, Redis, third party) | Circuit breaker, degrade feature, fail over the dependency |
| One region's health checks failing | Regional failover |
| No change, slow memory growth | Capture a dump, then restart, then investigate |
dotnet-dump collect or an App Service memory dump before restarting a leaking instance.A pricing service started returning 500s 4 minutes after a deploy. The slot swap back took 90 seconds and the error rate fell from 12% to 0.2%. The cause — a renamed configuration key — was found afterwards from the preserved logs, and ValidateOnStart was added so the next bad config fails in the staging slot instead.
Checks that the candidate prioritises customer recovery, knows the practical mitigation levers on Azure, and has the judgement to pick the right one safely.
Green flags
kubectl rollout undo, App Configuration flags, Front Door failover, rate limitingRed flags
cost of outage = minutes x (users affected x value per minute)
cost of mitigation = small, reversible change + some evidence risk
Root cause analysis benefits from calm and complete data; mitigation benefits from speed. Doing them in that order is cheaper than doing them together.
Most production incidents are triggered by change. Make changes visible in one place: deployment annotations on dashboards, App Configuration revision history, feature flag audit logs, and Azure Activity Log for infrastructure.
// Azure resource changes in the hour before impact
AzureActivity
| where TimeGenerated between (datetime(2026-11-20 00:30) .. datetime(2026-11-20 01:30))
| where OperationNameValue has_any ("write", "swap", "restart")
| project TimeGenerated, Caller, OperationNameValue, ResourceGroup, _ResourceId
| order by TimeGenerated asc
before swap after swap
production slot: v42 (new, bad) production slot: v41 (old, good)
staging slot: v41 (old, good) staging slot: v42
A swap just re-points hostnames after warming the target, so swapping back is fast — provided the old build is still in the staging slot. On AKS, Deployments keep revisionHistoryLimit ReplicaSets so kubectl rollout undo can go back.
The trap is the database: if v42 ran a migration that dropped or renamed a column, v41 breaks. The expand/contract pattern keeps every schema change compatible with the previous build.
Microsoft.FeatureManagement reads flags from configuration; with Azure App Configuration and a refresh interval (for example 30 seconds) a flag change reaches every instance without a deploy. A kill switch should default to the safe path and be tested in both states.
4 instances x 50 DB connections = 200 -> DB at 100% CPU
scale to 12 x 50 DB connections = 600 -> DB connection limit, timeouts everywhere
Scale out only when the bottleneck is the app tier itself. If a dependency is the bottleneck, reduce load on it: circuit breakers, caching, load shedding.
The built-in rate limiter (AddRateLimiter) can reject excess requests with 429 on non-critical endpoints, keeping capacity for the checkout path. Concurrency limiters cap in-flight work so latency stays bounded instead of the whole service collapsing.
Active-passive across Australia East and Southeast needs data replication (Azure SQL failover groups, geo-redundant storage), warm capacity in the secondary, and a rehearsed procedure. Failover with replication lag can lose recent writes — that is a business decision, so it should be agreed before the incident.
k6 to see 429s while the critical endpoint stays fast.dotnet-dump collect -p <pid> on a local app and practise analysing it with dotnet-dump analyze before you need it.A kill switch and load shedding in ASP.NET Core. The flag is read from Azure App Configuration so on-call can turn the feature off in seconds; the rate limiter keeps non-critical traffic from starving checkout.
// Program.cs
using Azure.Identity;
using Microsoft.AspNetCore.RateLimiting;
using Microsoft.FeatureManagement;
var builder = WebApplication.CreateBuilder(args);
// Flags and config come from Azure App Configuration and refresh every 30 seconds,
// so a kill switch takes effect without a deploy.
builder.Configuration.AddAzureAppConfiguration(options =>
options.Connect(new Uri(builder.Configuration["AppConfig:Endpoint"]!), new DefaultAzureCredential())
.UseFeatureFlags(flags => flags.SetRefreshInterval(TimeSpan.FromSeconds(30))));
builder.Services.AddAzureAppConfiguration();
builder.Services.AddFeatureManagement();
// Load shedding: cap the non-critical endpoints, never the checkout path.
builder.Services.AddRateLimiter(options =>
{
options.RejectionStatusCode = StatusCodes.Status429TooManyRequests;
options.AddConcurrencyLimiter("non-critical", o =>
{
o.PermitLimit = 50;
o.QueueLimit = 0; // reject immediately instead of queueing and growing latency
});
});
var app = builder.Build();
app.UseAzureAppConfiguration(); // triggers the config/flag refresh on requests
app.UseRateLimiter();
app.MapGet("/recommendations/{customerId}", async (string customerId, IFeatureManager features) =>
{
// Kill switch: when off, return a safe default instead of calling the slow recommender.
if (!await features.IsEnabledAsync("Recommendations"))
return Results.Ok(Array.Empty<string>());
return Results.Ok(new[] { "sku-1", "sku-2" }); // real call omitted
}).RequireRateLimiting("non-critical");
app.MapPost("/checkout", () => Results.Accepted()); // no limiter: protected path
app.Run();
Rollback commands on-call should have in the runbook:
# App Service: swap production back to the previous build in staging
az webapp deployment slot swap --resource-group rg-shop --name app-orders --slot staging --target-slot production
# AKS: roll back to the previous ReplicaSet and watch it finish
kubectl rollout undo deployment/orders-api -n shop
kubectl rollout status deployment/orders-api -n shop
# Capture evidence before restarting a leaking .NET process
dotnet-dump collect -p 1 -o /tmp/orders-api.dmp
The senior skill is preparing mitigations before incidents: every release can be rolled back in minutes, risky features ship behind flags, critical paths have load-shedding and degradation modes, and failover is rehearsed. In the incident itself the skill is restraint — one reversible change at a time, chosen from evidence about what changed.
Beyond one incident, a senior engineer builds the culture that makes this normal: a 'mitigation readiness' item in the definition of done (how do we turn this off or roll it back?), game days where the team practises failover and rollback on a schedule, and postmortem actions that shorten time to mitigate rather than only fixing the specific bug. Over a year that shows up as a falling time-to-mitigate trend.
| Lever | When it fits | Cost to have ready | When not to use it |
|---|---|---|---|
| Rollback | Recent deploy correlated with impact | Slots/image history, backward-compatible schema | Change can't be undone (data migrated destructively) |
| Feature flag | New or risky behaviour | Flag plumbing, testing both paths | Old flags left in code for years |
| Scale out | App tier is the saturated resource | Autoscale rules, quota | Dependency is the bottleneck |
| Failover | Region/zone failure | Paired-region capacity, replication | Small, local faults; replication lag unacceptable |
| Load shedding | Overload threatens the core journey | Rate limiter policies, priorities | Normal traffic patterns (hides capacity issues) |
Measure it with time to mitigate per incident: if most incidents take more than 15 minutes to mitigate, invest in faster rollback and flags before anything else.
I'd inventory and classify every setting first: secrets, environment-specific values, shared values, and which must change live. Secrets go to Key Vault. Non-secret settings and feature flags go to Azure App Configuration with a label per environment, and secrets are referenced from there through Key Vault references. The app authenticates with its managed identity using least-privilege roles, and where possible secrets disappear entirely through passwordless Entra ID auth to SQL, Storage and Service Bus.
For refresh, use a sentinel key with a refresh interval and a secret refresh interval, and read live values through IOptionsMonitor. Rotation uses overlapping versions, so old and new both work during the window. Add start-up timeouts and replicas, and keep ValidateOnStart.
The trade-off: central, audited, rotatable configuration, in exchange for a network dependency at start-up that you must design for.
Zero downtime means every migration must be compatible with the app version that is already running, because during a rolling deploy or slot swap the old and new code share one database. The pattern is expand/contract: first expand (add nullable columns, new tables, new indexes online), deploy code that writes both shapes, backfill in batches, switch reads, and only in a later release contract (drop the old column or table).
RenameColumn in one step.The trade-off: three or four small releases instead of one, in exchange for no outage and an easy rollback at every step.
An incident dashboard must answer three questions in the first screen: are users hurting, since when, and where. So the top row is SLO status and error budget, then RED for the service (rate, 5xx ratio, p50/p95/p99) with the SLO threshold drawn on the panels. The next row is RED for each dependency (database, downstream APIs, queues) so you can see where the fault starts. Below that, USE panels for the runtime, pods and database, collapsed by default.
Every time series carries deploy and feature-flag annotations, because most incidents follow a change, and panels link to traces and logs filtered to the same service and time window. One template as code with service and region variables serves every service.
The trade-off: fewer panels make it faster to read, but you need drill-down paths for the detail you removed.
How to tell it (STAR)
**S:** At [company], during [a sales peak] our orders API slowed to [3 s] p95, and the first response was to triple the pods. **T:** I [joined as the incident lead / was the second responder] and had to stop the errors climbing. **A:** I checked dotnet-counters and saw pod CPU was low but threads were waiting on SQL, so I scaled back down, turned off the order-history flag that ran the heavy query, and forced the previous plan in Query Store. **R:** Errors dropped from [30%] to under [1%] within [10] minutes, and we capped autoscaling by database capacity and added a 'where is the saturation?' step to the runbook.
Last updated 23 Nov 2026.