Site icon STARK ON SECURITY

Updating the Azure Monitor Agent on Demand

update-ama.ps1 is a PowerShell script you can use to update the Azure Monitor Agent on Azure Virtual Machines and Azure Arc Machines. The script will handle both Linux and Windows servers with the below features.

I have also written a universal extension upgrade script that can be used to upgrade any extension: update-extension.ps1

Usage

- Azure Arc does not return a detailed status of the update request

- The rest API only allows upgrading to Major.Minor versions. Therefore, you can't upgrade from 1.2 to 1.2.2 as an example, only to 1.3

Examples

Azure Virtual Machines

Update Azure Virtual Machines to a specific version

.\update-ama.ps1 -machines $(Get-AzVM) -linuxTargetVersion 1.22.2 -windowsTargetVersion 1.10.0.0

Update Azure Virtual Machines to the latest version of Windows and Linux

.\update-ama.ps1 -machines $(Get-AzVM) -latestVersion

Generate a report of Azure Virtual Machines with current versions

.\update-ama.ps1 -machines $(Get-AzVM) -latestVersion -report

Azure Arc Machines

Update Azure Arc Machines to a specific version

.\update-ama.ps1 -machines $(Get-AzConnectedMachine) -linuxTargetVersion 1.22.2 -windowsTargetVersion 1.10.0.0

Update Azure Arc Machines to the latest version of Windows and Linux

.\update-ama.ps1 -machines $(Get-AzConnectedMachine) -latestVersion

Generate a report of Azure Arc Machines with current versions

.\update-ama.ps1 -machines $(Get-AzConnectedMachine) -latestVersion -report
Exit mobile version