1
1
---
2
- title : Install and upgrade Azure Monitor Agent - Azure Arc-enabled servers
2
+ title : Install and upgrade Azure Monitor Agent on Azure Arc-enabled servers
3
3
titleSuffix : Azure Network Watcher
4
4
description : Learn how to install, upgrade, and uninstall Azure Monitor Agent on Azure Arc-enabled servers.
5
5
author : halkazwini
6
6
ms.author : halkazwini
7
7
ms.service : azure-network-watcher
8
8
ms.topic : how-to
9
- ms.date : 11/15/2023
9
+ ms.date : 03/25/2025
10
10
ms.custom : devx-track-azurecli, devx-track-azurepowershell
11
11
12
12
# Customer intent: As an Azure administrator, I need to install the Azure Monitor Agent on Azure Arc-enabled servers so I can monitor a connection using the Connection Monitor.
@@ -16,19 +16,19 @@ ms.custom: devx-track-azurecli, devx-track-azurepowershell
16
16
17
17
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] ( /azure/azure-monitor/agents/agents-overview?toc=/azure/network-watcher/toc.json ) .
18
18
19
- 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] ( /azure/azure-monitor/agents/azure-monitor-agent-manage?tabs=ARMAgentPowerShell%2CPowerShellWindows%2CPowerShellWindowsArc%2CCLIWindows%2CCLIWindowsArc ) .
19
+ 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] ( /azure/azure-monitor/agents/azure-monitor-agent-manage?toc=/azure/network-watcher/toc.json ) .
20
20
21
21
## Use PowerShell
22
22
23
23
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.
24
24
25
25
### Install on Azure Arc-enabled servers
26
26
Use the following PowerShell command to install Azure Monitor Agent on Azure Arc-enabled servers.
27
- # [ Windows] ( #tab/PowerShellWindowsArc )
27
+ # [ Windows] ( #tab/windows )
28
28
``` powershell
29
29
New-AzConnectedMachineExtension -Name AMAWindows -ExtensionType AzureMonitorWindowsAgent -Publisher Microsoft.Azure.Monitor -ResourceGroupName <resource-group-name> -MachineName <arc-server-name> -Location <arc-server-location>
30
30
```
31
- # [ Linux] ( #tab/PowerShellLinuxArc )
31
+ # [ Linux] ( #tab/linux )
32
32
``` powershell
33
33
New-AzConnectedMachineExtension -Name AMALinux -ExtensionType AzureMonitorLinuxAgent -Publisher Microsoft.Azure.Monitor -ResourceGroupName <resource-group-name> -MachineName <arc-server-name> -Location <arc-server-location>
34
34
```
@@ -37,11 +37,11 @@ New-AzConnectedMachineExtension -Name AMALinux -ExtensionType AzureMonitorLinuxA
37
37
### Uninstall on Azure Arc-enabled servers
38
38
Use the following PowerShell command to uninstall Azure Monitor Agent from Azure Arc-enabled servers.
39
39
40
- # [ Windows] ( #tab/PowerShellWindowsArc )
40
+ # [ Windows] ( #tab/windows )
41
41
``` powershell
42
42
Remove-AzConnectedMachineExtension -MachineName <arc-server-name> -ResourceGroupName <resource-group-name> -Name AMAWindows
43
43
```
44
- # [ Linux] ( #tab/PowerShellLinuxArc )
44
+ # [ Linux] ( #tab/linux )
45
45
``` powershell
46
46
Remove-AzConnectedMachineExtension -MachineName <arc-server-name> -ResourceGroupName <resource-group-name> -Name AMALinux
47
47
```
@@ -51,12 +51,12 @@ Remove-AzConnectedMachineExtension -MachineName <arc-server-name> -ResourceGroup
51
51
52
52
To perform a * one-time upgrade* of the agent, use the following PowerShell commands.
53
53
54
- # [ Windows] ( #tab/PowerShellWindowsArc )
54
+ # [ Windows] ( #tab/windows )
55
55
``` powershell
56
56
$target = @{"Microsoft.Azure.Monitor.AzureMonitorWindowsAgent" = @{"targetVersion"=<target-version-number>}}
57
57
Update-AzConnectedExtension -ResourceGroupName $env.ResourceGroupName -MachineName <arc-server-name> -ExtensionTarget $target
58
58
```
59
- # [ Linux] ( #tab/PowerShellLinuxArc )
59
+ # [ Linux] ( #tab/linux )
60
60
``` powershell
61
61
$target = @{"Microsoft.Azure.Monitor.AzureMonitorLinuxAgent" = @{"targetVersion"=<target-version-number>}}
62
62
Update-AzConnectedExtension -ResourceGroupName $env.ResourceGroupName -MachineName <arc-server-name> -ExtensionTarget $target
@@ -69,11 +69,11 @@ You can install Azure Monitor Agent on Azure virtual machines and on Azure Arc-e
69
69
### Install on Azure Arc-enabled servers
70
70
Use the following Azure CLI commands to install Azure Monitor Agent on Azure Arc-enabled servers.
71
71
72
- # [ Windows] ( #tab/CLIWindowsArc )
72
+ # [ Windows] ( #tab/windows )
73
73
``` azurecli
74
74
az connectedmachine extension create --name AzureMonitorWindowsAgent --publisher Microsoft.Azure.Monitor --type AzureMonitorWindowsAgent --machine-name <arc-server-name> --resource-group <resource-group-name> --location <arc-server-location>
75
75
```
76
- # [ Linux] ( #tab/CLILinuxArc )
76
+ # [ Linux] ( #tab/linux )
77
77
``` azurecli
78
78
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>
79
79
```
@@ -82,23 +82,23 @@ az connectedmachine extension create --name AzureMonitorLinuxAgent --publisher M
82
82
### Uninstall on Azure Arc-enabled servers
83
83
Use the following Azure CLI commands to uninstall Azure Monitor Agent from Azure Arc-enabled servers.
84
84
85
- # [ Windows] ( #tab/CLIWindowsArc )
85
+ # [ Windows] ( #tab/windows )
86
86
``` azurecli
87
87
az connectedmachine extension delete --name AzureMonitorWindowsAgent --machine-name <arc-server-name> --resource-group <resource-group-name>
88
88
```
89
- # [ Linux] ( #tab/CLILinuxArc )
89
+ # [ Linux] ( #tab/linux )
90
90
``` azurecli
91
91
az connectedmachine extension delete --name AzureMonitorLinuxAgent --machine-name <arc-server-name> --resource-group <resource-group-name>
92
92
```
93
93
---
94
94
95
95
### Upgrade on Azure Arc-enabled servers
96
96
To perform a * one time upgrade* of the agent, use the following CLI commands:
97
- # [ Windows] ( #tab/CLIWindowsArc )
97
+ # [ Windows] ( #tab/windows )
98
98
``` azurecli
99
99
az connectedmachine upgrade-extension --extension-targets "{\"Microsoft.Azure.Monitor.AzureMonitorWindowsAgent\":{\"targetVersion\":\"<target-version-number>\"}}" --machine-name <arc-server-name> --resource-group <resource-group-name>
100
100
```
101
- # [ Linux] ( #tab/CLILinuxArc )
101
+ # [ Linux] ( #tab/linux )
102
102
``` azurecli
103
103
az connectedmachine upgrade-extension --extension-targets "{\"Microsoft.Azure.Monitor.AzureMonitorWindowsAgent\":{\"targetVersion\":\"<target-version-number>\"}}" --machine-name <arc-server-name> --resource-group <resource-group-name>
104
104
```
@@ -113,11 +113,11 @@ To install the Network Watcher extension on your Azure Arc-enabled servers with
113
113
114
114
You can also use the following command to install the Network Watcher extension in your Azure Arc-enabled machine with Azure Monitor Agent extension.
115
115
116
- # [ Windows] ( #tab/PowerShellWindowsArc )
116
+ # [ Windows] ( #tab/windows )
117
117
``` powershell
118
118
New-AzConnectedMachineExtension -Name AzureNetworkWatcherExtension -ExtensionType NetworkWatcherAgentWindows -Publisher Microsoft.Azure.NetworkWatcher -ResourceGroupName $rg -MachineName $vm -Location $location
119
119
```
120
- # [ Linux] ( #tab/PowerShellLinuxArc )
120
+ # [ Linux] ( #tab/linux )
121
121
``` powershell
122
122
New-AzConnectedMachineExtension -Name AzureNetworkWatcherExtension -ExtensionType NetworkWatcherAgentLinux -Publisher Microsoft.Azure.NetworkWatcher -ResourceGroupName $rg -MachineName $vm -Location $location
123
123
```
0 commit comments