Introduction

Completed

Contoso Tile supplies independent flooring shops. To get tile onto the afternoon truck, a shop needs a quote before noon. Each virtual machine (VM) in Contoso's Azure scale set runs one instance of the Quote Worker application as a Linux service. The service reads room dimensions from a private queue, calculates how many tiles the shop needs, and saves the quote in the order system. The queue and order system are separate from the VMs, so pending requests and completed quotes survive a VM replacement.

Contoso's architecture

Contoso runs the quote service on four Standard_D2s_v5 VMs in a single Azure Virtual Machine Scale Set in East US 2. The scale set uses Uniform orchestration: instead of configuring each VM separately, Contoso maintains one model that specifies the VM size, an exact Ubuntu 24.04 LTS image version, a managed OS disk per VM, and the extension settings that install the approved Quote Worker application release.

The VMs share a private subnet. A network security group filters traffic, and a NAT gateway provides outbound internet access without giving any VM a public IP address. Shops don't connect to a VM directly: whichever copy of the quote service picks up a request from the queue calculates the tile quantity and writes the result to the order system. This is why the application needs neither an inbound load balancer nor a particular VM to handle a shop's next order.

Contoso uses the scale set to change capacity without changing how shops submit requests. Scaling from four VMs to five creates a VM from the current model and adds another copy of the service to process the same queue. Scaling in removes a VM, so its in-flight request must finish or be safe to retry. Contoso normally uses four VMs and permits between three and five when scaling is enabled.

Keeping the queue and order system outside the VMs protects stored requests and quotes, but it doesn't by itself protect a request already being processed. This example assumes that Contoso's queue makes an uncompleted request available again after a consumer fails. The quote service acknowledges completion only after the result is durably saved. The order system uses the logical request ID to make repeated completion attempts produce one durable quote outcome, including when different VMs process duplicate deliveries concurrently. An ID used only for tracing wouldn't provide that protection.

Contoso establishes this behavior before enabling unattended disruptive operations. An automatic scale-in or repair isn't a promise of graceful application shutdown: requests must remain safe to retry even when a VM fails without warning.

The same model also governs releases and replacements. During a rolling release, Contoso updates one of the four VMs at a time. The Application Health extension probes the local quote service before Azure proceeds to the next batch; the other three VMs can keep processing orders. If the first updated VM fails that check, adding or replacing a VM would install the release in the current model, not the version still running on the other three. Contoso keeps scaling and repairs off until it restores the approved model and confirms that the quote service runs correctly on every VM.

Diagram that shows four private VMs taking quote requests from a shared queue and saving results in Contoso's order system.

Contoso's scenario

On shipping days, Contoso's support team schedules a reference quote every 15 minutes from 08:00 until the noon order cutoff, local warehouse time. Each request describes the same 7 ft by 7 ft entryway, uses no customer data, and has a unique request ID. The expected quote is 49 one-square-foot tiles before cuts or waste. Before the next scheduled request, support looks up the quote by request ID. If the quote is missing or lists anything other than 49 tiles, the on-call engineer investigates. A successful quote shows that one copy of the service processed the request, not that all four VMs are healthy.

Diagram that shows the 15-minute reference check: support looks up the request ID and investigates a missing or incorrect 49-tile quote.

Releases prompt additional checks. Immediately before each rollout, support checks both local endpoints on all four VMs: on v1, /health returns HTTP 200 and /work returns {"release":"v1","result":49}. After each batch, support checks the updated VM. The Application Health extension probes /health independently every five seconds. Minutes before noon, v2-bad installs on the first VM. The VM stays up and /work still returns 49, but the reported release is v2-bad and /health returns 503. The engineer checks the rollout immediately and cancels it if it's still active. Capacity stays at four: a fifth VM would install v2-bad. After recovery, support checks all four VMs and sends a fresh quote through the queue before closing the incident.

Diagram that shows why a 503 stops the rollout even when the tile count is correct, and how support confirms recovery.

Environmental prerequisites

Before a release, Contoso checks the following:

Area What must be ready
Operator access For the PowerShell examples, sign in with the Azure CLI, confirm the subscription with az account show, and set $Rg and $Name to the intended resource group and scale set. The operator needs access to instance views, the Activity log, and Azure Monitor metrics, plus permission for any approved change.
VMs and diagnostics All four Uniform scale-set VMs run the pinned Ubuntu image and the approved v1 quote service. The Linux VM agent must be working for extensions and Run Command. The guest diagnostic uses python3 on the VM, not on the operator's computer. Keep a private management route available if Run Command fails.
Application connectivity and identity From each VM, the quote service must be able to resolve and reach both the private queue and the order system. Its application identity, not the operator's account, needs permission to consume requests and save quotes. Configure that access for VMs created from the model as well as existing VMs; a replacement can't depend on credentials installed by hand on its predecessor.
Recovery artifacts and capacity The release pipeline must be able to retrieve the approved v1 installer, exact image version, deployment template, and reviewed parameters. Before counting on a fifth VM, confirm spare subnet addresses, regional and VM-family quota, and an approved budget.

Where the extension downloads an installer or package, confirm that the VMs can retrieve the approved version using the configured download mechanism. Check guest DNS, routing, and any required download authorization, including for VMs created from the model. The pipeline's access doesn't establish the VM's access. Keep protected settings in the approved release process rather than trying to reconstruct them from a model export.

Diagram that shows the access, guest diagnostics, application permissions, and release artifacts Contoso needs for recovery.

Confirm the baseline at two levels. On each VM, the Application Health extension must report stable health for 127.0.0.1:8080/health, and /work must report v1 and 49 tiles. Through the normal order path, submit a non-customer 7 ft by 7 ft quote request and confirm that the order system saves 49 tiles under that request's identifier. A passing local check doesn't prove the service can read the queue or write the result.

Automatic repairs and autoscale aren't prerequisites. Contoso starts in Manual upgrade mode at four VMs, with both features off. It uses Rolling mode for the release only after the baseline is healthy. During recovery it keeps capacity fixed and repairs off; it considers repair or scaling separately after the approved model and application are restored.

Diagram that shows VMs waiting for an operator update in Manual mode and Azure stopping a Rolling upgrade after one VM fails its health check.