What Azure cli command to schedule updates in Azure Update Manager?

Handinata Tanudjaja 80 Reputation points
2025-01-27T18:25:55.1566667+00:00

Hi everyone,

What's the Azure cli command to schedule updates in Azure update manager?
All I see so far is to do it via Portal but I want to be able to do it via cli.

Thank you

Azure Update Manager
Azure Update Manager
An Azure service to centrally manages updates and compliance at scale.
339 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Vinod Pittala 75 Reputation points Microsoft Vendor
    2025-01-28T00:35:12.15+00:00

    Hi Handinata Tanudjaja

    Welcome to Microsoft Q&A Forum, thank you for posting your query here!

    We understood that you are seeking a particular Azure CLI commands to create and manage the schedule updates in Azure update manager.
    kindly refer to the below MS document, it covers the Azure CLI options for using this feature.

    https://learn.microsoft.com/en-us/azure/virtual-machines/maintenance-configurations-cli

    Below are the steps to create and manage the schedule updates in Azure update manager.

    1. Create the maintenance configuration
    2. Assign the configuration
    3. Check the configuration
    4. Post the configuration set up, we can check the pending updates
    5. We could Apply updates if we had any pending updates
    6. Check the status of applying updates
    7. If we want to Delete the maintenance configuration, we can use the appropriate CLI command.

    Provided the commands for all the above-mentioned steps in the below article, please use it accordingly.

    https://learn.microsoft.com/en-us/azure/virtual-machines/maintenance-configurations-cli

    Example commands to create the maintenance configuration.
    So, use az maintenance configuration create command to create a maintenance configuration. Here as an instance the scope has selected as host machines, with a scheduled window of 5 hours on the fourth Monday of every month:

    Note: Please replace your values in the below command

    *az maintenance configuration create 
       --resource-group myMaintenanceRG \
       --resource-name myConfig \
       --maintenance-scope host \
       --location eastus \
       --maintenance-window-duration "05:00" \
       --maintenance-window-recur-every "Month Fourth Monday" \
       --maintenance-window-start-date-time "2020-12-30 08:00" \
       --maintenance-window-time-zone "Pacific Standard Time" 
    

    Post maintenance configuration creation, follow the above-mentioned steps with the appropriate CLI commands.

    Please let us know if you have any further queries. I’m happy to assist you.  

    If the above Answer is helpful, please click "Upvote it"


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.