@Abrar Adil S You can use pre and post events feature within Azure Update Manager. 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.
For more information, refer this document.