@Vishu Thanks for your question. As mentioned by community member Azar, there is no direct feature within azure update manager to execute script before patching , however there are some pre and post events that can be done before patching a server through Azure Update Manager. Here are the pre and post events that can be done before patching through Azure Update Manager. Kindly check if these can be helpful. Pre Events:
Post Events:
Reference documents: https://learn.microsoft.com/en-us/azure/update-manager/manage-pre-post-events