Disable Auto Updates on VMs created from custom images

Maxim Zaytsev 6 Reputation points
2020-01-15T11:15:49.353+00:00

How can I disable auto updates on VMs created from custom images

I've tried to configure image with

Set-ItemProperty -Path "HKLM:SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU"  -Name NoAutoUpdate -Value 1

But after deployment is complete, NoAutoUpdate key is set to 0

What is the right approach here?

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,083 questions
Azure DevTest Labs
Azure DevTest Labs
An Azure service that is used for provisioning development and test environments.
254 questions
{count} vote

2 answers

Sort by: Most helpful
  1. jakaruna-MSFT 596 Reputation points Microsoft Employee
    2020-01-21T12:28:38.77+00:00

    Can you set that VM's "enableAutomaticUpdates" to false as shown below and try again.

    "osProfile.windowsConfiguration.enableAutomaticUpdates" Set this property to false Then rebbot and check for the registry key.

    By default that value is set to true.

    You can change that value through powershell or rest api.
    In powershell just get the vm though get-azvm and change that value and set with set-azvm.

    Try this out and let me know

    0 comments No comments

  2. Cosme Junior 21 Reputation points
    2021-07-02T14:03:03.913+00:00

    @jakaruna-MSFT

    111373-image.png

    Automatic modes to Manual mode is currently not supported

    Switching from AutomaticByOS mode to AutomaticByPlatfom mode is supported.

    I think we can't disable for already created machines, must be or manage by OS or by Platform.......

    I did what you said, after the restart of the VM, the value kept as 1, however I am not sure if the next time the windows update runs, it will not start up automatically, since the other properties remain the same

    osProfile.windowsConfiguration.enableAutomaticUpdates=true
    osProfile.windowsConfiguration.patchSettings.patchMode=AutomaticByPlatform

    do you know how I can check this parameters for the existing VM I have, is this on the registry ?

    https://learn.microsoft.com/en-us/azure/virtual-machines/windows/tutorial-config-management#manage-windows-updates

    0 comments No comments