Error while accessing Update Settings in my VM

Nathan Collins 1 Reputation point
2022-12-14T14:01:29.983+00:00

I'm trying to set up automatic VM guest patching, but whenever I go to the "Update Settings" on my VM, I keep getting "Error occured while fetching the data for the selected machine(s), please try again." - has anyone else had this issue?

I have tried through the az cli too, but I get a different error message :

az vm update --resource-group "my-resource-group" --name "my-vm" --set osProfile.windowsConfiguration.enableAutomaticUpdates=true osProfile.windowsConfiguration.patchSettings.patchMode=AutomaticByPlatform

Couldn't find 'windowsConfiguration' in 'osProfile'. 'osProfile' does not support further indexing.

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
8,493 questions
Azure Update Manager
Azure Update Manager
An Azure service to centrally manages updates and compliance at scale.
357 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Ramya Harinarthini_MSFT 5,351 Reputation points Microsoft Employee
    2022-12-14T17:40:08.77+00:00

    @Anonymous Welcome to Microsoft Q&A, thank you for posting your here!!

    Could you please try to follow below process to enable automatic VM guest patching

    • Validate the extension isn't enabled You shouldn't see a patch setting section.
      az vm get-instance-view --resource-group myResourceGroup --name myVM  
      
    • Enable the Preview for the subscription
        az feature register --namespace Microsoft.Compute --name InGuestAutoPatchVMPreview  
        az provider register -n Microsoft.Compute  
      
      It can take up to 15 minutes, but you can check the status with az feature show --namespace Microsoft.Compute --name InGuestAutoPatchVMPreview
    • Update the existing VM to have it
         az vm update --resource-group myResourceGroup --name myVM --set  
         osProfile.windowsConfiguration.enableAutomaticUpdates=true  
         osProfile.windowsConfiguration.patchSettings.patchMode=AutomaticByPlatform  
      
    • Now validate you got it...
        az vm get-instance-view --resource-group myResourceGroup --name myVM  
      
      You should see: "patchSettings": {
      "patchMode": "AutomaticByPlatform"
      },

    Hope this helps!
    Kindly let us know if the above helps or you need further assistance on this issue.


    Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.


  2. KarishmaTiwari-MSFT 20,587 Reputation points Microsoft Employee
    2022-12-20T06:39:44.59+00:00

    @Anonymous Thanks for sharing the update.

    Please check on the following and let me know the results in the comments. If you are still seeing this issue after confirming on the following, I will further investigate on it.

    Reference documentation : Automatic VM guest patching for Azure VMs

    0 comments No comments

  3. RUSHABHKUMAR B SHAH 0 Reputation points
    2025-03-10T00:28:46.7166667+00:00

    Hello @Anonymous

    I'm facing issue to change Machine patching orchestration from Manual to Customer Managed schedule.

    getting below error.

    Saving update settings failed for 1 out of 1 machine(s) Failed for the following : myvm : The patchMode 'AutomaticByPlatform' is invalid. For patchMode 'AutomaticByPlatform', the property 'enableAutomaticUpdates' must be set to true. Also, this operation cannot be performed when extension operations are disallowed. To allow, please ensure VM Agent is installed on the VM and the osProfile.allowExtensionOperations property is true.

    Can you please help.

    I tried to change through script and tried to change os profile through azure PowerShell but didn't work as well as tried to change registry setting from machine but wasn't get success. if you can help me.

    0 comments No comments

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.