This set of runbooks demonstrates how you could install / manage Windows Updates on an Azure VM, as demonstrated in the Azure Automation announcement. It is intended for demonstration purposes only and is not meant for production use.

 

This solution works by enumerating all VMs in your Azure subscription, and for each one:

  1. Check if the VM contains the PSWindowsUpdate PowerShell Module, which lets you manage Windows Update from PowerShell
  2. If not: Download the zipped up module from the Azure Blob Store to the worker running the runbook, copy it from the worker to the Azure VM, and unzip the module into the PSPath on the Azure VM
  3. Get the list of available updates from Windows Update by calling a cmdlet of the PSWindowsUpdate module on the Azure VM (the runbook only shows listing the updates, but the module includes cmdlets for installing updates, etc, as well).


In addition to what’s in this download, you will need a management cert with access to your Azure subscription. You will also need to place the PSWindowsUpdate.zip file as a blob in an Azure storage account in your Azure subscription.
 

In Azure Automation: 

    1.    Connect-Azure
    2.    Connect-AzureVM
    3.    Copy-ItemToAzureVM
    4.    Copy-FileFromAzureStorageToAzureVM
    5.    Install-ModuleOnAzureVM
    6.    Update-AzureVM

 

PowerShell Workflow
Edit|Remove