Share via

Powershell script to update AZure Linux VM patch Mode remotely

Azuretech 95 Reputation points
2023-11-02T07:56:33.9433333+00:00

I need to update patch mode of a linux vm remotely using PowerShell.

It is "Azure Managed - Safe Deployment ," at moment and need to update to 'Image Default"

Azure Update Manager
Azure Update Manager

An Azure service to centrally manages updates and compliance at scale.


1 answer

Sort by: Most helpful
  1. SwathiDhanwada-MSFT 19,088 Reputation points Moderator
    2023-11-06T14:20:45.71+00:00

    Azuretech You can use below commands to set the patch orchestration of the Linux VM.

    $VirtualMachine = Get-AzVM -ResourceGroupName "myResourceGroup" -Name "myVM"
    Set-AzVMOperatingSystem -VM $VirtualMachine -Linux -PatchMode "ImageDefault"
    Update-AzVM -VM $VirtualMachine -ResourceGroupName "myResourceGroup"
    

    Was this answer helpful?

    0 comments No comments

Your answer

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