Reconcile and close the campaign

Completed

At the end of Contoso's orders window, IT Operations needs to account for both replicas, even if only orders-01 has an installation record. A deliberate hold on orders-02 is different from an approved update that never ran. Compare what was approved with what actually happened, record whether orders recovered, and give any unfinished work an owner and a deadline.

Start with the approved manifest, not just the machines with an installation row. Match approved VMs to actual targets by full resource ID, ignoring letter case; machine names can repeat across subscriptions. The correlation ID identifies the maintenance run. Installation activity IDs, event IDs, and Automation job IDs identify separate records, so keep each with its result. Retain the evidence needed to answer five questions:

Decision Evidence to retain
Was this VM approved and reached? Manifest and preview, direct assignment reads, resolved IDs, assessment time and eligibility, configuration and run IDs, approval owner and time
Did the handlers act? Event type, delivery and job IDs, timestamps, pre- and post-handler results or errors, cancellation request and confirmed status if applicable
What did the guest install? Approved update selection, canary-installed KB/package-version evidence, explained differences for this target, installation summary and KB/package detail, counts by outcome, errors, window overrun, reboot result and observed boot time
Did the workload recover? Traffic isolation/drain completion, per-instance health observations and timestamps, traffic restoration decision and post-restoration observations, service-level health on remaining replicas, and the application owner's promotion or hold decision
Can the campaign close? One classification per target and attempt, reasons for exclusions and exceptions, next action, named owner, UTC due date, and closure decision and authority

Diagram that shows the target, handler, installation, and workload records used to decide whether the orders patch campaign can close.

In Azure Resource Graph Explorer, select the campaign subscriptions and query patchinstallationresources for VM installation summaries modified in the past day. Converting the resource path to lowercase before extracting the VM ID lets you match records even when their IDs use different capitalization. Use the reported maintenance run ID to select the occurrence under review; don't assume every installation in that time range belongs to it.

patchinstallationresources
| where type =~ 'microsoft.compute/virtualmachines/patchinstallationresults'
| where todatetime(properties.lastModifiedDateTime) > ago(1d)
| extend vmId = tostring(split(tolower(id), '/patchinstallationresults/')[0])
| project vmId, resultId = id, runId = tostring(properties.maintenanceRunId),
          installation = tostring(properties.status), reboot = tostring(properties.rebootStatus),
          installed = toint(properties.installedPatchCount), failed = toint(properties.failedPatchCount),
          pending = toint(properties.pendingPatchCount), windowExceeded = tobool(properties.maintenanceWindowExceeded)

Export both the summary and relevant softwarepatches details, the maintenanceresources rows, and the handler and application records. Resource Graph retains assessment history for seven days and installation history for thirty days. Aim to export the records within 24 hours of the run. Remove secrets before archiving the records, and use your organization's retention policy to decide how long to keep them.

Classify the campaign outcome, not just the Azure installation field:

Outcome Interpretation and action
Successful Correct target, selected updates accounted for, reboot completed or not required, handlers passed, and workload health accepted.
Failed A required action or workload check is known to have failed. Stop promotion and assign remediation.
Canceled A timely cancellation was confirmed for this occurrence. Save the Cancelled response. Check the targeted VMs' installation histories to confirm that none started installing updates for that run.
Skipped or excluded Record why a VM or update wasn't patched: it was outside the approved scope, it wasn't eligible, or the run skipped it. If the only evidence is a missing result, classify the outcome as Unknown, not Skipped.
Pending Known work remains, such as completing a required reboot. Assign an owner and deadline.
Unknown Evidence is missing or contradictory. Don't convert a missing row or absent handler output into success.

Diagram that shows six outcomes for a patch attempt: successful, failed, canceled, skipped or excluded, pending, and unknown.

For example, Succeeded installation plus Required reboot, a failed post-handler and no application result means installation succeeded, reboot pending, handler failed, application unknown. Record all four outcomes and keep the next wave on hold. Name an owner to confirm that the required reboot completes and that the application works afterward. If installation reached an unapproved VM instead of an approved one, also notify the unexpected VM's owner, preserve assignment and delivery evidence, and arrange a separately approved attempt for the missed VM.

Troubleshooting and retiring a campaign

Use the first failed condition to choose the next action rather than retrying the whole wave:

Problem First investigation Decision
Update-source failure Guest source settings, proxy, repository access, assessment errors Repair the source, reassess, and defer scheduling until eligibility is known.
Unsupported orchestration Actual patch settings and supported image With approval, set Customer Managed Schedules on the intended Azure VMs. Finish changes more than 40 minutes before a run with pre-events; otherwise defer to a new window.
Patching incomplete in a shared availability set Check installation errors, actual completion times, and other schedules targeting VMs in the same availability set, including other workloads. Don't assume every missing result has this cause. Coordinate campaign times, or allow a longer supported window when appropriate. Keep later campaigns on hold when their planned separation depends on unfinished earlier operations.
An existing configuration triggers at an older time Compare the old and new schedule settings, change time, planned occurrences, and actual run ID/start time. A cached maintenance policy might still use the old trigger time. Don't assume a schedule edit canceled an occurrence. Confirm its state and, if necessary, request cancellation before the cutoff and confirm Cancelled. Microsoft recommends editing an existing configuration at least one hour before the intended run. Contact Microsoft support if the old time keeps triggering runs.
Membership drift or incomplete visibility Approved versus resolved IDs, assignment scope, role and deny assignments, query completeness For a verified run, request cancellation before the earlier of CancellationCutOffDateTime and start minus ten minutes. Confirm Cancelled and obtain approval for the corrected VM list.
Missing or failed handler Event Grid delivery metrics, job errors, identity, modules The on-call operator identifies the approved occurrence in maintenance history, requests cancellation on that run while there's still time, and confirms Cancelled. Don't wait for a job that never started or for the customer run-record store to recover.
Missed cutoff or unconfirmed cancellation Event and request timestamps, run status, machine installation history Escalate, monitor actual execution, and stop later waves.
Required reboot or application failure VM-model reboot setting, maintenance configuration option, guest restart policies, reboot result, boot time, service state, last successful operation, guest logs Hold promotion; complete the approved recovery with the workload owner.

Diagram that shows how the first failed check guides the operator's next action, from repairing an update source to holding a later wave.

Before retiring campaign-specific resources, reconcile any active run and export the evidence. Remove only obsolete static and dynamic assignments and expired configurations. On each affected VM, open Updates > Scheduling. Confirm that the retired schedule is no longer listed and that any remaining schedules are intentional. Remove campaign-only Event Grid subscriptions, disable and remove short-lived webhooks, and revoke temporary role grants. Retire unused runbooks, variables and identities only after all post-event work is complete. Restore previous orchestration settings only with the VM owner's approval; retain shared infrastructure and account for ongoing disk, network and recovery costs.