Validate the canary and decide whether to promote
For Contoso's orders service, promotion means authorizing orders-02 to receive the update after orders-01. The orders owner needs to know what the canary installed, whether its required restart finished, and whether it can serve an order lookup itself. If a lookup succeeds through the load balancer but times out on the canary, keep orders-02 serving traffic and hold its update.
After cancellation, correct the reason for the failed check rather than weakening the check. For example, if the Orders process is running but can't read its database, restore connectivity and demonstrate a successful order lookup before requesting a fresh window. Keep the previous attempt's record. Before retrying, reassess the VMs, confirm the target list, obtain approval for the new window, and freeze assignment changes again. Track the retry under its own run ID.
For a canary that proceeds, collect evidence in this order:
- Before installation, confirm the source, eligible updates, reboot state, exact membership, completed traffic drain, and positive pre-handler result. Monitor the unpatched replicas independently; a healthy canary baseline says nothing about their ability to carry traffic.
- Let installation and any required reboot finish. Don't restart the VM to hurry the operation. In History, inspect installed, failed, excluded, not-selected and pending updates, window overruns, errors and reboot status. Compare the guest boot time with the run timestamps.
- Inspect the post-handler job, then check the patched instance itself. Use a workload-owned signal, such as a successful order lookup against the canary and the time it completed. A request to a load balancer can succeed entirely on the unpatched replica.
- Apply the agreed observation period. Once the patched VM is reachable again, run the application health check against that VM five times, one minute apart. Record the UTC time, full VM ID, and result for each check. A failed or missing sample, a required but incomplete reboot, or an unexplained error blocks promotion, even if the service currently responds.
After the patched instance passes the agreed direct checks, the workload owner authorizes its controlled return to service. Confirm the routing/readiness state changed as intended and observe that the restored replica can handle its share of normal work. Hold the other replica's update until this acceptance and the agreed observation period are complete. A post-maintenance event or a successful reboot alone doesn't authorize traffic restoration.
If cancellation is confirmed after a drain, verify the occurrence didn't start installation and the VM is healthy before restoring its traffic. If cancellation is unconfirmed or installation may have started, don't automatically rejoin the VM based on its earlier healthy baseline. Keep the workload owner responsible for recovery and routing while the actual run and guest state are established.
For one read-only observation on a Windows guest, supply the existing application's Windows service name as $ServiceName and its heartbeat file path as $HeartbeatPath. The file must contain the UTC timestamp of the last successful workload operation, such as an order lookup on that instance. A stand-in service or the file's modification time doesn't establish that orders work.
param(
[Parameter(Mandatory)][string]$ServiceName,
[Parameter(Mandatory)][string]$HeartbeatPath
)
$ErrorActionPreference = 'Stop'
$service = Get-Service -Name $ServiceName
$lastSuccess = [DateTimeOffset]::Parse((Get-Content -LiteralPath $HeartbeatPath -Raw).Trim())
$observed = [DateTimeOffset]::UtcNow
$age = ($observed - $lastSuccess).TotalSeconds
[pscustomobject]@{
observedUtc = $observed
service = $service.Status
ageSeconds = [math]::Round($age, 1)
lastBoot = (Get-CimInstance Win32_OperatingSystem).LastBootUpTime
healthy = ($service.Status -eq 'Running' -and $age -ge 0 -and $age -lt 30)
}
For a workload with a 30-second freshness threshold, the service must be running and its last successful operation must be less than 30 seconds old. A future timestamp fails too. Count the sample as a pass only if the script returns healthy = True. If it can't read the heartbeat, record the sample as missing. A successful exit code alone doesn't prove the application is healthy. Windows' Component Based Servicing RebootPending and Windows Update RebootRequired registry keys are useful indicators, not an exhaustive reboot detector. Reconcile them with the assessment and installation result. On Linux, use the application's actual probe, service status, boot time and distribution-specific reboot indicator.
Promotion is a recorded decision. The application owner records whether to approve or hold the next wave and when that decision was made (UTC). Include the canary run ID, its installed KBs or package versions, its health results, the approved later-wave update selection and explained differences, and the full resource ID of every VM covered by the decision.
Only after approval does the patch operator create the later configuration and assignment. Allow time to assess the targets, confirm source access and reboot state, and finish membership changes more than 40 minutes before a start with pre-events. Give the later wave's handler its own approval settings, webhook, and scoped permissions. Leave the canary's settings unchanged until its post-event work finishes. For the new run, compare the actual VM IDs with the approved list, require a pre-event pass, and reconcile installation, reboot, post-event, and per-instance health results. A missed, skipped, or excluded VM doesn't become a later-wave target without explicit approval.
Before scheduling the later wave, record its approved update selection and explain any differences from the canary's installed updates. For a schedule with pre-events, finish target-assignment changes more than 40 minutes before the start. If editing an existing maintenance configuration, follow the recommendation to update it at least one hour before the scheduled run to mitigate cached old trigger times. A last-minute schedule edit isn't a way to cancel a verified occurrence. During prechecks, hold the wave if newly discovered changes invalidate that approval; don't edit the schedule inside the freeze to make it fit. If the run is already scheduled, request cancellation of the verified occurrence before the earlier of its event cutoff and ten minutes before the start, then confirm Cancelled. After installation, compare actual KBs and package versions with the approved change and record any difference before declaring success.