About pre and post events

Applies to: ✔️ Windows VMs ✔️ Linux VMs ✔️ On-premises environment ✔️ Azure Arc-enabled servers.

The pre and post events in Azure Update Manager allow you to perform certain tasks automatically before and after a scheduled maintenance configuration. For example, using pre-and-post events, you can:

  • Start VMs to apply patches and stop the VMs again.
  • Stop service on the machine, apply patches, and restart the service.

The pre-events run before the patch installation begins and the post-events run after the patch installation ends. If the VM requires a reboot, it happens before the post-event begins.

Update Manager uses Event Grid to create and manage pre and post events on scheduled maintenance configurations. In the Event Grid, you can choose from Azure Webhooks, Azure Functions, Storage accounts, and Event hub to trigger your pre and post activity. If you're using pre and post events in Azure Automation Update management and plan to move to Azure Update Manager, we recommend that you use Azure Webhooks linked to Automation Runbooks.

User scenarios

The following are the scenarios where you can define pre and post events:

Scenario Description
Turn on machines Turn on the machine to apply updates.
Create snapshot Disk snaps used to recover data.
Start/configure Windows Update (WU) Ensures that the WU is up and running before patching is attempted.
Notification email Send a notification alert before patching is triggered.
Add network security group Add the network security group.
Stop services To stop services like Gateway services, NPExServices, SQL services etc.

Next steps