How to Install Guest configuration Agent on Azure VM?

Guest configuration Extension also known as Guest configuration Agent. This article shows you about how to install guest configuration extention on Windows Azure VM and on Linux Azure VM using powershell script.

How to Install Windows Guest configuration in Azure?

Run the below PowerShell script either from azure Cloud Shell or with Azure Windows PowerShell to Install Windows Guest Configuration Agent.

## PowerShell Script to Install Windows Guest Configuration Agent
$RGName = "_add_rg_name_here"
$VMLocation = "_add_vm_location_here"
$VMName = "_add_avm_name_here"

Set-AzVMExtension `
-Publisher 'Microsoft.GuestConfiguration' `
-Type 'ConfigurationforWindows' `
-Name 'AzurePolicyforWindows' `
-TypeHandlerVersion 1.0 `
-ResourceGroupName '$RGName' `
-Location '$VMLocation' `
-VMName '$VMName' `
-EnableAutomaticUpgrade $true

How to Install Linux Guest configuration in Azure?

Run the below PowerShell script either from azure Cloud Shell or with Azure Windows PowerShell to Install Linux Guest Configuration Agent.

## PowerShell Script to Install Linux Guest Configuration Agent

$RGName = "_add_rg_name_here"
$VMName = "_add_vm_location_here"
$VMName = "_add_avm_name_here"

Set-AzVMExtension 
-Publisher 'Microsoft.GuestConfiguration' `
-Type 'ConfigurationforLinux' `
-Name 'AzurePolicyforLinux' `
-TypeHandlerVersion 1.0 `
-ResourceGroupName '$RGName' `
-Location '$VMName' `
-VMName '$VMName' `
-EnableAutomaticUpgrade $true