Skip to content

Commit 5c4cb11

Browse files
committed
add portal, powershell, cli, and arm deployment instructions
1 parent 3806466 commit 5c4cb11

File tree

3 files changed

+200
-16
lines changed

3 files changed

+200
-16
lines changed
47 KB
Loading
48.1 KB
Loading

articles/virtual-machines/extensions/network-watcher-linux.md

Lines changed: 200 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,18 @@ ms.topic: how-to
99
ms.collection: linux
1010
ms.date: 03/31/2024
1111
ms.custom: devx-track-azurepowershell, devx-track-azurecli, devx-track-arm-template, linux-related-content
12+
13+
#CustomerIntent: As an Azure administrator, I want to learn about Network Watcher Agent VM extension so that I can use Network watcher features to diagnose and monitor my Linux virtual machines (VMs).
1214
---
1315

1416
# Manage Network Watcher Agent virtual machine extension for Linux
1517

1618
> [!CAUTION]
1719
> This article references CentOS, a Linux distribution that is nearing End Of Life (EOL) status. Please consider your use and planning accordingly. For more information, see the [CentOS End Of Life guidance](~/articles/virtual-machines/workloads/centos/centos-end-of-life.md).
1820
19-
[Azure Network Watcher](../../network-watcher/network-watcher-monitoring-overview.md) is a network performance monitoring, diagnostic, and analytics service that allows monitoring for Azure networks. The Network Watcher Agent virtual machine extension is a requirement for some of the Network Watcher features on Azure virtual machines (VMs), such as capturing network traffic on demand, and other advanced functionality.
21+
The Network Watcher Agent virtual machine extension is a requirement for some of Azure Network Watcher features that capture network traffic to diagnose and monitor Azure virtual machines (VMs). For more information, see [What is Azure Network Watcher?](../../network-watcher/network-watcher-overview.md)
2022

21-
In this article, you learn about the supported platforms and deployment options for the Network Watcher Agent VM extension for Linux. Installation of the agent doesn't disrupt, or require a reboot of the virtual machine. You can install the extension on virtual machines that you deploy. If the virtual machine is deployed by an Azure service, check the documentation for the service to determine whether or not it permits installing extensions in the virtual machine.
23+
In this article, you learn how to install and uninstall Network Watcher Agent for Linux. Installation of the agent doesn't disrupt, or require a reboot of the virtual machine. If the virtual machine is deployed by an Azure service, check the documentation of the service to determine whether or not it permits installing extensions in the virtual machine.
2224

2325
> [!NOTE]
2426
> Network Watcher Agent extension is not supported on AKS clusters.
@@ -29,13 +31,17 @@ In this article, you learn about the supported platforms and deployment options
2931

3032
- An Azure Linux virtual machine (VM). For more information, see [Supported operating systems](#supported-operating-systems).
3133

32-
- Internet connectivity: some of the Network Watcher Agent functionality requires that the virtual machine is connected to the internet. For example, without the ability to establish outgoing connections, the Network Watcher Agent can't upload packet captures to your storage account. For more information, see [Packet capture overview](../../network-watcher/packet-capture-overview.md).
34+
- Outbound TCP connectivity to `169.254.169.254` over `port 80` and `168.63.129.16` over `port 8037`. The agent uses these IP addresses to communicate with the Azure platform.
35+
36+
- Internet connectivity: Network Watcher Agent requires internet connectivity for some features to properly work. For example, it requires connectivity to your storage account to upload packet captures. For more information, see [Packet capture overview](../../network-watcher/packet-capture-overview.md).
3337

3438
# [**PowerShell**](#tab/powershell)
3539

3640
- An Azure Linux virtual machine (VM). For more information, see [Supported operating systems](#supported-operating-systems).
3741

38-
- Internet connectivity: some of the Network Watcher Agent functionality requires that the virtual machine is connected to the internet. For example, without the ability to establish outgoing connections, the Network Watcher Agent can't upload packet captures to your storage account. For more information, see [Packet capture overview](../../network-watcher/packet-capture-overview.md).
42+
- Outbound TCP connectivity to `169.254.169.254` over `port 80` and `168.63.129.16` over `port 8037`. The agent uses these IP addresses to communicate with the Azure platform.
43+
44+
- Internet connectivity: Network Watcher Agent requires internet connectivity for some features to properly work. For example, it requires connectivity to your storage account to upload packet captures. For more information, see [Packet capture overview](../../network-watcher/packet-capture-overview.md).
3945

4046
- Azure Cloud Shell or Azure PowerShell.
4147

@@ -47,7 +53,9 @@ In this article, you learn about the supported platforms and deployment options
4753

4854
- An Azure Linux virtual machine (VM). For more information, see [Supported operating systems](#supported-operating-systems).
4955

50-
- Internet connectivity: some of the Network Watcher Agent functionality requires that the virtual machine is connected to the internet. For example, without the ability to establish outgoing connections, the Network Watcher Agent can't upload packet captures to your storage account. For more information, see [Packet capture overview](../../network-watcher/packet-capture-overview.md).
56+
- Outbound TCP connectivity to `169.254.169.254` over `port 80` and `168.63.129.16` over `port 8037`. The agent uses these IP addresses to communicate with the Azure platform.
57+
58+
- Internet connectivity: Network Watcher Agent requires internet connectivity for some features to properly work. For example, it requires connectivity to your storage account to upload packet captures. For more information, see [Packet capture overview](../../network-watcher/packet-capture-overview.md).
5159

5260
- Azure Cloud Shell or Azure CLI.
5361

@@ -59,7 +67,9 @@ In this article, you learn about the supported platforms and deployment options
5967

6068
- An Azure Linux virtual machine (VM). For more information, see [Supported operating systems](#supported-operating-systems).
6169

62-
- Internet connectivity: some of the Network Watcher Agent functionality requires that the virtual machine is connected to the internet. For example, without the ability to establish outgoing connections, the Network Watcher Agent can't upload packet captures to your storage account. For more information, see [Packet capture overview](../../network-watcher/packet-capture-overview.md).
70+
- Outbound TCP connectivity to `169.254.169.254` over `port 80` and `168.63.129.16` over `port 8037`. The agent uses these IP addresses to communicate with the Azure platform.
71+
72+
- Internet connectivity: Network Watcher Agent requires internet connectivity for some features to properly work. For example, it requires connectivity to your storage account to upload packet captures. For more information, see [Packet capture overview](../../network-watcher/packet-capture-overview.md).
6373

6474
- Azure PowerShell or Azure CLI installed locally to deploy the template.
6575

@@ -83,7 +93,7 @@ Network Watcher Agent extension for Linux can be installed on the following Linu
8393
| Oracle Linux | 6.10, 7 and 8+ |
8494
| Red Hat Enterprise Linux (RHEL) | 6.10, 7, 8 and 9.2 |
8595
| Rocky Linux | 9.1 |
86-
| SUSE Linux Enterprise Server (SLES) | 12 and 15 (SP2, SP3 and SP4) |
96+
| SUSE Linux Enterprise Server (SLES) | 12 and 15 (SP2, SP3, and SP4) |
8797
| Ubuntu | 16+ |
8898

8999
> [!NOTE]
@@ -112,28 +122,202 @@ The following JSON shows the schema for the Network Watcher Agent extension. The
112122
}
113123
```
114124

115-
## Template deployment
125+
## List installed extensions
126+
127+
# [**Portal**](#tab/portal)
128+
129+
From the virtual machine page in the Azure portal, you can view the installed extension by following these steps:
130+
131+
1. Under **Settings**, select **Extensions + applications**.
132+
133+
1. In the **Extensions** tab, you can see all installed extensions on the virtual machine. If the list is long, you can use the search box to filter the list.
134+
135+
:::image type="content" source="./media/network-watcher/list-vm-extensions.png" alt-text="Screenshot that shows how to view installed extensions on a VM in the Azure portal." lightbox="./media/network-watcher/list-vm-extensions.png":::
136+
137+
# [**PowerShell**](#tab/powershell)
138+
139+
Use [Get-AzVMExtension](/powershell/module/az.compute/get-azvmextension) cmdlet to list all installed extensions on the virtual machine:
140+
141+
```azurepowershell-interactive
142+
# List the installed extensions on the virtual machine.
143+
Get-AzVMExtension -ResourceGroupName 'myResourceGroup' -VMName 'myVM' | format-table Name, Publisher, ExtensionType, EnableAutomaticUpgrade
144+
```
145+
146+
The output of the cmdlet lists the installed extensions:
116147

117-
You can deploy Azure VM extensions with an Azure Resource Manager template (ARM template) using the previous JSON [schema](#extension-schema).
148+
```output
149+
Name Publisher ExtensionType AutoUpgradeMinorVersion EnableAutomaticUpgrade
150+
---- --------- ------------- ----------------------- ----------------------
151+
AzureNetworkWatcherExtension Microsoft.Azure.NetworkWatcher NetworkWatcherAgentLinux True True
152+
```
118153

119-
## Azure CLI deployment
154+
# [**Azure CLI**](#tab/cli)
120155

121-
The following example deploys the Network Watcher Agent VM extension to an existing VM deployed through Resource Manager:
156+
Use [az vm extension list](/cli/azure/vm/extension#az-vm-extension-list) command to list all installed extensions on the virtual machine:
122157

123158
```azurecli
124-
az vm extension set --resource-group myResourceGroup1 --vm-name myVM1 --name NetworkWatcherAgentLinux --publisher Microsoft.Azure.NetworkWatcher --version 1.4
159+
# List the installed extensions on the virtual machine.
160+
az vm extension list --resource-group 'myResourceGroup' --vm-name 'myVM' --out table
161+
```
162+
163+
The output of the command lists the installed extensions:
164+
165+
```output
166+
Name ProvisioningState Publisher Version AutoUpgradeMinorVersion
167+
---------------------------- ------------------- ------------------------------ --------- -------------------------
168+
AzureNetworkWatcherExtension Succeeded Microsoft.Azure.NetworkWatcher 1.4 True
125169
```
126170

127-
## Troubleshooting
171+
# [**Resource Manager**](#tab/arm)
172+
173+
N/A
174+
175+
---
176+
177+
## Install Network Watcher Agent VM extension
178+
179+
# [**Portal**](#tab/portal)
180+
181+
From the virtual machine page in the Azure portal, you can install the Network Watcher Agent VM extension by following these steps:
182+
183+
1. Under **Settings**, select **Extensions + applications**.
184+
185+
1. Select **+ Add** and search for **Network Watcher Agent** and install it. If the extension is already installed, you can see it in the list of extensions.
186+
187+
:::image type="content" source="./media/network-watcher/vm-extensions.png" alt-text="Screenshot that shows the VM's extensions page in the Azure portal." lightbox="./media/network-watcher/vm-extensions.png":::
128188

129-
You can retrieve data about the state of extension deployments using either the Azure portal or Azure CLI.
189+
1. In the search box of **Install an Extension**, enter *Network Watcher Agent for Linux*. Select the extension from the list and select **Next**.
130190

131-
The following example shows the deployment state of the NetworkWatcherAgentLinux extension for a VM deployed through Resource Manager, using the Azure CLI:
191+
:::image type="content" source="./media/network-watcher/install-extension-linux.png" alt-text="Screenshot that shows how to install Network Watcher Agent for Linux in the Azure portal." lightbox="./media/network-watcher/install-extension-linux.png":::
192+
193+
1. Select **Review + create** and then select **Create**.
194+
195+
# [**PowerShell**](#tab/powershell)
196+
197+
Use [Set-AzVMExtension](/powershell/module/az.compute/set-azvmextension) cmdlet to install Network Watcher Agent VM extension on the virtual machine:
198+
199+
```azurepowershell-interactive
200+
# Install Network Watcher Agent for Linux on the virtual machine.
201+
Set-AzVMExtension -Name 'AzureNetworkWatcherExtension' -Publisher 'Microsoft.Azure.NetworkWatcher' -ExtensionType 'NetworkWatcherAgentLinux' -EnableAutomaticUpgrade 1 -TypeHandlerVersion '1.4' -ResourceGroupName 'myResourceGroup' -VMName 'myVM'
202+
```
203+
204+
Once the installation is successfully completed, you see the following output:
205+
206+
```output
207+
RequestId IsSuccessStatusCode StatusCode ReasonPhrase
208+
--------- ------------------- ---------- ------------
209+
True OK
210+
```
211+
212+
# [**Azure CLI**](#tab/cli)
213+
214+
Use [az vm extension set](/cli/azure/vm/extension#az-vm-extension-set) command to install Network Watcher Agent VM extension on the virtual machine:
215+
216+
```azurecli
217+
# Install Network Watcher Agent for Windows on the virtual machine.
218+
az vm extension set --name 'NetworkWatcherAgentLinux' --extension-instance-name 'AzureNetworkWatcherExtension' --publisher 'Microsoft.Azure.NetworkWatcher' --enable-auto-upgrade 'true' --version '1.4' --resource-group 'myResourceGroup' --vm-name 'myVM'
219+
```
220+
221+
# [**Resource Manager**](#tab/arm)
222+
223+
Use the following Azure Resource Manager template (ARM template) to install Network Watcher Agent VM extension on a Linux virtual machine:
224+
225+
```json
226+
{
227+
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
228+
"contentVersion": "1.0.0.0",
229+
"parameters": {
230+
"vmName": {
231+
"type": "string"
232+
}
233+
},
234+
"variables": {},
235+
"resources": [
236+
{
237+
"name": "[parameters('vmName')]",
238+
"type": "Microsoft.Compute/virtualMachines",
239+
"apiVersion": "2023-03-01",
240+
"location": "[resourceGroup().location]",
241+
"properties": {
242+
}
243+
},
244+
{
245+
"name": "[concat(parameters('vmName'), '/AzureNetworkWatcherExtension')]",
246+
"type": "Microsoft.Compute/virtualMachines/extensions",
247+
"apiVersion": "2023-03-01",
248+
"location": "[resourceGroup().location]",
249+
"dependsOn": [
250+
"[concat('Microsoft.Compute/virtualMachines/', parameters('vmName'))]"
251+
],
252+
"properties": {
253+
"autoUpgradeMinorVersion": true,
254+
"publisher": "Microsoft.Azure.NetworkWatcher",
255+
"type": "NetworkWatcherAgentLinux",
256+
"typeHandlerVersion": "1.4"
257+
}
258+
}
259+
],
260+
"outputs": {}
261+
}
262+
```
263+
264+
You can use either Azure PowerShell or Azure CLI to deploy the Resource Manager template:
265+
266+
```azurepowershell
267+
# Deploy the JSON template file using Azure PowerShell.
268+
New-AzResourceGroupDeployment -ResourceGroupName 'myResourceGroup' -TemplateFile 'agent.json'
269+
```
132270

133271
```azurecli
134-
az vm extension show --name NetworkWatcherAgentLinux --resource-group myResourceGroup1 --vm-name myVM1
272+
# Deploy the JSON template file using the Azure CLI.
273+
az deployment group create --resource-group 'myResourceGroup' --template-file 'agent.json'
135274
```
136275

276+
---
277+
278+
## Uninstall Network Watcher Agent VM extension
279+
280+
# [**Portal**](#tab/portal)
281+
282+
From the virtual machine page in the Azure portal, you can uninstall the Network Watcher Agent VM extension by following these steps:
283+
284+
1. Under **Settings**, select **Extensions + applications**.
285+
286+
1. Select **AzureNetworkWatcherExtension** from the list of extensions, and then select **Uninstall**.
287+
288+
:::image type="content" source="./media/network-watcher/uninstall-extension-linux.png" alt-text="Screenshot that shows how to uninstall Network Watcher Agent for Linux in the Azure portal." lightbox="./media/network-watcher/uninstall-extension-linux.png":::
289+
290+
> [!NOTE]
291+
> In the list of extensions, you might see Network Watcher Agent VM extension named differently than **AzureNetworkWatcherExtension**.
292+
293+
# [**PowerShell**](#tab/powershell)
294+
295+
Use [Remove-AzVMExtension](/powershell/module/az.compute/remove-azvmextension) cmdlet to remove Network Watcher Agent VM extension from the virtual machine:
296+
297+
```azurepowershell-interactive
298+
# Uninstall Network Watcher Agent VM extension.
299+
Remove-AzureVMExtension -Name 'AzureNetworkWatcherExtension' -ResourceGroupName 'myResourceGroup' -VMName 'myVM'
300+
```
301+
302+
# [**Azure CLI**](#tab/cli)
303+
304+
Use [az vm extension delete](/cli/azure/vm/extension#az-vm-extension-delete) command to remove Network Watcher Agent VM extension from the virtual machine:
305+
306+
```azurecli-interactive
307+
# Uninstall Network Watcher Agent VM extension.
308+
az vm extension delete --name 'AzureNetworkWatcherExtension' --resource-group 'myResourceGroup' --vm-name 'myVM'
309+
```
310+
311+
# [**Resource Manager**](#tab/arm)
312+
313+
N/A
314+
315+
---
316+
317+
## Frequently asked questions (FAQ)
318+
319+
To get answers to most frequently asked questions about Network Watcher Agent, see [Network Watcher Agent FAQ](../../network-watcher/frequently-asked-questions#network-watcher-agent).
320+
137321
## Related content
138322

139323
- [Update Azure Network Watcher extension to the latest version](network-watcher-update.md).

0 commit comments

Comments
 (0)