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.
7,081 questions
Azure Update Manager
Azure Update Manager
An Azure service to centrally manages updates and compliance at scale.
212 questions
0 comments No comments
{count} votes

2 answers

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

    @Nathan Collins 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 18,352 Reputation points Microsoft Employee
    2022-12-20T06:39:44.59+00:00

    @Nathan Collins 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