Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Azure Monitor Agent is implemented as an Azure virtual machine (VM) extension. You can install Azure Monitor Agent using any of the methods described in Azure Monitor Agent overview.
This article covers installing Azure Monitor Agent on Azure Arc-enabled servers using PowerShell or the Azure CLI. For more information, see Manage Azure Monitor Agent.
You can install Azure Monitor Agent on Azure virtual machines and on Azure Arc-enabled servers by using New-AzConnectedMachineExtension
, the PowerShell cmdlet for adding a virtual machine extension.
Use the following PowerShell command to install Azure Monitor Agent on Azure Arc-enabled servers.
New-AzConnectedMachineExtension -Name AMALinux -ExtensionType AzureMonitorLinuxAgent -Publisher Microsoft.Azure.Monitor -ResourceGroupName <resource-group-name> -MachineName <arc-server-name> -Location <arc-server-location>
Use the following PowerShell command to uninstall Azure Monitor Agent from Azure Arc-enabled servers.
Remove-AzConnectedMachineExtension -MachineName <arc-server-name> -ResourceGroupName <resource-group-name> -Name AMALinux
To perform a one-time upgrade of the agent, use the following PowerShell commands.
$target = @{"Microsoft.Azure.Monitor.AzureMonitorLinuxAgent" = @{"targetVersion"=<target-version-number>}}
Update-AzConnectedExtension -ResourceGroupName $env.ResourceGroupName -MachineName <arc-server-name> -ExtensionTarget $target
You can install Azure Monitor Agent on Azure virtual machines and on Azure Arc-enabled servers by using the Azure CLI command for adding a virtual machine extension.
Use the following Azure CLI commands to install Azure Monitor Agent on Azure Arc-enabled servers.
az connectedmachine extension create --name AzureMonitorLinuxAgent --publisher Microsoft.Azure.Monitor --type AzureMonitorLinuxAgent --machine-name <arc-server-name> --resource-group <resource-group-name> --location <arc-server-location>
Use the following Azure CLI commands to uninstall Azure Monitor Agent from Azure Arc-enabled servers.
az connectedmachine extension delete --name AzureMonitorLinuxAgent --machine-name <arc-server-name> --resource-group <resource-group-name>
To perform a one time upgrade of the agent, use the following CLI commands:
az connectedmachine upgrade-extension --extension-targets "{\"Microsoft.Azure.Monitor.AzureMonitorWindowsAgent\":{\"targetVersion\":\"<target-version-number>\"}}" --machine-name <arc-server-name> --resource-group <resource-group-name>
After your machine is Azure Arc-enabled, it's recognized as an Azure resource. After you enable the Azure Monitor Agent extension, install the Network Watcher extension. The process is similar to installing the Network Watcher extension in an Azure VM.
To make Connection Monitor recognize your Azure Arc-enabled on-premises machines with the Azure Monitor Agent extension as monitoring sources, install the Network Watcher agent virtual machine extension on them. This extension is also known as the Network Watcher extension. To install the Network Watcher extension on your Azure Arc-enabled servers with the Azure Monitor Agent extension installed, see Monitoring connectivity from Azure virtual machines and virtual machine scale sets.
You can also use the following command to install the Network Watcher extension in your Azure Arc-enabled machine with Azure Monitor Agent extension.
New-AzConnectedMachineExtension -Name AzureNetworkWatcherExtension -ExtensionType NetworkWatcherAgentLinux -Publisher Microsoft.Azure.NetworkWatcher -ResourceGroupName $rg -MachineName $vm -Location $location