ADR: Blue-green on a $13 plan, measured and held
Status: accepted, 2026-10-07 (1.0.3.96), and what it accepts is holding. The rolls were measured first, the cheapest fix shipped on its own in 1.0.3.89 (the container answers before it loads the catalogue), and the second copy of each site that blue-green needs was not created: on Steve's word, "1 for now", and on the plan's memory, which has no room for it. This record keeps what was measured, what each option costs, and what would bring it back.
In plain words
Every deploy of this site takes it offline for a few minutes. The usual cure is blue-green deployment: two copies of the site, the new version started on the idle copy, and visitors moved across only once it answers. On Azure that is usually deployment slots, which need the Standard tier at about $56 a month more than this site's plan. This record measured where the minutes go before buying anything, shipped the one fix that costs nothing, and found that the rest of the minutes belong to the platform swapping the container on its single instance, which only a second copy running beside the first removes. That second copy does not fit in the plan's memory, so it waits.
What that is worth: a visitor's slow minutes after a deploy shrank from as much as two minutes to a few seconds, a developer can see why the offline stretch is still there and what removing it would cost, and the organization was not sold a tier to fix a stretch it could measure first.
Context
Steve, 7 October: "When a deployment happens all of the api end points are frozen for 30 sec." Both sites run on one Linux B1 plan, one core and 1.75 GB, about $13 a month (ADR: One plan, two sites).
Before any code (read only). The three rolls Application Insights held in full, 1.0.3.84, 1.0.3.85 and 1.0.3.87, read from 20 minutes before each roll to 20 after; times are seconds from the start of the deploy's roll step.
Three things that reading settled. Writing the app settings did not restart the live site: they were written at +6 s and the old container served normally for two minutes after. The roll does not overlap the containers: on one instance the old container stopped answering minutes before the new one listened. And the new container listened late because it loaded a hundred thousand vehicles first, on the core both sites share.
Decision
Listen first, load after (1.0.3.89, $0). The host answers at once and loads the catalogue beside the server; every API read waits for the load without holding a thread, and /readyz says not ready until the catalogue is in (ADR: The ports learn to wait).
_ = Task.Run(async () =>
{
try
{
var stopping = lifetime.ApplicationStopping;
await backends.Default.Startup.Time("bids", backends.Default.Bids.LoadAsync, stopping);
await backends.Default.Startup.Time("catalogue", backends.Default.Inventory.WarmAsync, stopping);
backends.Default.Startup.Ready();
}
catch (Exception ex) when (!lifetime.ApplicationStopping.IsCancellationRequested)
{
logger.LogCritical(ex, "The {Store} store could not be loaded; stopping, so the platform restarts the container", backends.Default.Name);
lifetime.StopApplication();
}
}, CancellationToken.None);
Live from api/TheYard.Api/Shared/Hosted/CatalogueWarm.cs, region listen-first, read from this build at 99df7a8.
Readiness on every store, for whatever swaps next. /readyz?stores=all answers 200 only once every store the host runs has its catalogue in (ADR: The order of the request pipeline). It is the read a roll waits on before it moves a visitor, whether that roll is a second copy, a slot, or a second instance.
No second copy yet. The green apps, the color-aware roll and the edge function that flips between colors were written and not merged.
Every roll since, read the same way
A probe on Steve's machine reads each site's origin (/, /healthz, /api/version, /api/facets) and domain (/api/version) every two seconds through each roll (scripts/probe-roll.py). Its 30 seconds is a limit on each wait on the socket, not on the read, so a read whose answer arrives in pieces can run past it. The roll of 1.0.3.95 logged good answers of 41.8 to 45.8 s; three other rolls logged failed reads of 40 to 57 s. Application Insights stops recording at its daily cap in the afternoon, so these numbers come from the probe, a different instrument from the table above.
Two columns, read the same way on every row. The first is the longest stretch in which an address got no good answer, from the shortest of the ten addresses to the longest. The second is the slowest good read that was sent after that site's API had answered under the new version, for the Azure SQL site then the Azure Cosmos DB site: the reads sent before it are queued through the swap and answered together the moment the container listens, so each of them reads as the 26 to 30 s it waited and says nothing about the new container. The logs are greenlane-probe-103NN.log.
The stretch with no answer has held at two to five minutes through every change inside the container, /healthz included, which answers the moment the process listens and reads no store. Those minutes are App Service stopping the old container, pulling the new image and starting it on its one instance. The 23.4 s on the Azure SQL site at 1.0.3.95 is one stall eight and a half minutes after the start: every address of that site, /healthz included, answered nothing for 23 s and then answered together, while the Azure Cosmos DB container beside it answered throughout; what paused it was not measured.
What it costs, against what it replaces
What would bring it back
Steve asking for zero-downtime deploys at about $13 a month, or the plan's memory falling far enough that two more containers fit. The code that was written is kept on its own branch and is not described here as if it shipped; this record links only what is on the main branch.
Addendum, 2026-10-08 (1.0.3.98): the table read again against its logs
Every number in this record was read again against the probe logs. Two things were wrong and are corrected above rather than left standing. The probe was described as giving up on a read at 30 seconds; its 30 seconds is a socket timeout on each wait, and the logs hold good answers of 41.8 to 45.8 s. The slowest-answer column had mixed two readings: the 1.0.3.89 row gave the slowest read sent after the new container's API had answered, while the rows after it gave the probe's own summary figure, which is the longest a read queued through the swap waited and comes out near 30 s on every roll. The column now gives the first reading on every row, and the rolls of 1.0.3.95 to 1.0.3.97 are added. The stretch with no answer stays the platform's, and the rolls since 1.0.3.94 are read in ADR: Compiled before it ships, the addendum on the four rolls.
Where it sits
Outside the rings: the deploy and the plan. One change reached the host, listening before the catalogue is loaded, in the API ring's startup, and it changed no port. Single responsibility: the host says when it is ready, and the roll, whichever one ships, decides when to move a visitor.
Addendum, 2026-10-20 (1.0.3.188): listening first, from a hosted service
From 1.0.3.188 the listen-first warm is Hosted/CatalogueWarm.cs rather than a region of Composition/Startup.cs, which is gone (ADR: The onion cut into vertical slices, rule 2). It starts the load when the host starts and returns at once; what the deploy and a swap wait on, /readyz, is unchanged.
Addendum, 2026-10-21 (1.0.4.24): the plan and the copy, now
The record's plan is a B1 and a second plan for the copy is weighed above. Since 8 October the plan is a B2, which the rendering service runs on beside the API (ADR: A rendering service beside the API); no second copy runs during rolls; and since 19 October one web app serves both sites and The Shed (ADR: One web app for every .NET process), so the thirty-second freeze this record measured is one app's swap.
Addendum, 2026-11-16 (1.0.5.51): two rolls read in seconds, and the words that describe them
What stopped being true: that a roll takes the site offline for minutes. The same probe read two rolls in November from WickedAwsome, every two seconds on ten addresses for 25 minutes: 1.0.5.19 on 11 November and 1.0.5.42 on 12 November. On every address the longest stretch with no good answer was 2 to 4 seconds, where 2 is the probe's own interval and 4 is one read that got no good answer; the slowest good read after the new version answered was 1.2 and 1.8 seconds at 1.0.5.19 and 4.2 and 4.1 seconds at 1.0.5.42 (the Performance page, "What a deploy costs a visitor", has both rows and the log names). What is still true: no second copy runs during a roll, so the site is not blue-green and a roll is not one with no downtime. Until this version the first screen said the site "rolled blue and green, with no downtime", beside the button that opens this record; it now says it rolled in place by the pipeline, behind one gate, and a test holds the first screen and the review stops to never saying blue-green, "blue and green", "no downtime" or "zero downtime" while this record says the second copy was not created. Whether the first screen may name the few seconds is the owner's call and is not taken here.
Enforced by
Not machine-checked. Held by review.