@Abrar Adil S , thank you for posting this question.
You are going in the right direction. Here are the high-level steps which are required to enable Azure Automation Update Management.
- Install Log Analytics Agent (aka Microsoft Monitoring Agent) on the VM
- Include it in Azure Automation Update Management.
For first step (install LA agent on new VM), you can use Azure Initiative - Legacy - Enable Azure Monitor for VMs This initiative contains a set of Azure Policy which installs/configures LA agent on all VMs - Azure, On-prem using Arc for both - Windows and Linux VMs. For assigning Azure Initiative, please see Quickstart: Create a policy assignment to identify non-compliant resources.
The initiative will install and configure LA agent to report to a particular LA workspace (which should be linked to Azure Automation).
For the second step (configure VM for update management), you can follow the step as mentioned here - Enable machines in the workspace. You can choose the option "Enable on all available and future machines" so that any new machine which starts reporting to LA workspace, the Azure Automation Update would get enabled for that VM.
Hope this helps.
If the answer did not help, please add more context/follow-up question for it, and we will help you out. Else, if the answer helped, please click Accept answer so that it can help others in the community looking for help on similar topics.