Skip to content

Commit 1e524d2

Browse files
committed
freshness
1 parent a817cf4 commit 1e524d2

File tree

4 files changed

+63
-47
lines changed

4 files changed

+63
-47
lines changed
156 KB
Loading
63.5 KB
Loading
136 KB
Loading
Lines changed: 63 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,30 @@
11
---
2-
title: Create an Azure Network Watcher instance | Microsoft Docs
2+
title: Create an Azure Network Watcher instance
33
description: Learn how to create an Azure Network Watcher in an Azure region by using the Azure portal or other technologies, and how to delete a Network Watcher.
44
services: network-watcher
5-
documentationcenter: na
65
author: damendo
76
ms.assetid: b1314119-0b87-4f4d-b44c-2c4d0547fb76
87
ms.service: network-watcher
98
ms.topic: how-to
10-
ms.tgt_pltfrm: na
11-
ms.workload: infrastructure-services
12-
ms.date: 10/08/2021
9+
ms.workload: infrastructure-services
10+
ms.date: 12/30/2022
1311
ms.author: damendo
14-
ms.custom: devx-track-azurepowershell, devx-track-azurecli, engagement-fy23
12+
ms.custom: template-how-to, devx-track-azurepowershell, devx-track-azurecli, engagement-fy23
1513
ms.devlang: azurecli
1614
---
1715

1816
# Create an Azure Network Watcher instance
1917

2018
Network Watcher is a regional service that enables you to monitor and diagnose conditions at a network scenario level in, to, and from Azure. Scenario level monitoring enables you to diagnose problems at an end to end network level view. Network diagnostic and visualization tools available with Network Watcher help you understand, diagnose, and gain insights to your network in Azure. Network Watcher is enabled through the creation of a Network Watcher resource. This resource allows you to utilize Network Watcher capabilities.
2119

22-
23-
[!INCLUDE [updated-for-az](../../includes/updated-for-az.md)]
24-
2520
## Network Watcher is automatically enabled
26-
When you create or update a virtual network in your subscription, Network Watcher will be enabled automatically in your Virtual Network's region. There's no impact to your resources or associated charge for automatically enabling Network Watcher.
21+
When you create or update a virtual network in your subscription, Network Watcher will be enabled automatically in your Virtual Network's region. Automatically enabling Network Watcher doesn't affect your resources or associated charge.
2722

28-
#### Opt-out of Network Watcher automatic enablement
23+
### Opt-out of Network Watcher automatic enablement
2924
If you would like to opt out of Network Watcher automatic enablement, you can do so by running the following commands:
3025

3126
> [!WARNING]
32-
> Opting-out of Network Watcher automatic enablement is a permanent change. Once you opt-out, you cannot opt-in without contacting [support](https://azure.microsoft.com/support/options/).
27+
> Opting-out of Network Watcher automatic enablement is a permanent change. Once you opt-out, you cannot opt-in without contacting [Azure support](https://azure.microsoft.com/support/options/).
3328
3429
```azurepowershell-interactive
3530
Register-AzProviderFeature -FeatureName DisableNetworkWatcherAutocreation -ProviderNamespace Microsoft.Network
@@ -40,45 +35,53 @@ Register-AzResourceProvider -ProviderNamespace Microsoft.Network
4035
az feature register --name DisableNetworkWatcherAutocreation --namespace Microsoft.Network
4136
az provider register -n Microsoft.Network
4237
```
38+
## Prerequisites
4339

44-
40+
- An Azure account with an active subscription. [Create one for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
4541

4642
## Create a Network Watcher in the portal
4743

48-
1. Log into the [Azure portal](https://portal.azure.com) with an account that has the necessary permissions.
49-
2. Select **More services**.
50-
3. In the **All services** screen, enter **Network Watcher** in the **Filter services** search box and select it from the search result.
51-
You can select all the subscriptions you want to enable Network Watcher for. This action creates a Network Watcher in every region that is available.
44+
1. Sign in to the [Azure portal](https://portal.azure.com) with an account that has the necessary permissions.
45+
46+
2. In the search box at the top of the portal, enter *Network Watcher*.
47+
48+
3. In the search results, select **Network Watcher**.
49+
50+
4. Select **+ Add**.
5251

53-
![create a network watcher](./media/network-watcher-create/figure1.png)
52+
5. In **Add network watcher**, select your Azure subscription, then select the region that you want to enable Azure Network Watcher for.
5453

55-
When you enable Network Watcher using the portal, the name of the Network Watcher instance is automatically set to *NetworkWatcher_region_name* where *region_name* corresponds to the Azure region where the instance is enabled. For example, a Network Watcher enabled in the West Central US region is named *NetworkWatcher_westcentralus*.
54+
6. Select **Add**.
55+
56+
:::image type="content" source="./media/network-watcher-create/create-network-watcher.png" alt-text="Screenshot showing how to create a Network Watcher in the Azure portal.":::
57+
58+
When you enable Network Watcher using the Azure portal, the name of the Network Watcher instance is automatically set to *NetworkWatcher_region_name*, where *region_name* corresponds to the Azure region of the Network Watcher instance. For example, a Network Watcher enabled in the East US region is named *NetworkWatcher_eastus*.
5659

5760
The Network Watcher instance is automatically created in a resource group named *NetworkWatcherRG*. The resource group is created if it doesn't already exist.
5861

59-
If you wish to customize the name of a Network Watcher instance and the resource group it's placed into, you can use PowerShell, the Azure CLI, the REST API, or ARMClient methods described in the sections that follow. In each option, the resource group must exist before you create a Network Watcher in it.
62+
If you wish to customize the name of a Network Watcher instance and the resource group it's placed into, you can use [PowerShell](#powershell) or [REST API](#restapi) methods. In each option, the resource group must exist before you create a Network Watcher in it.
6063

61-
## Create a Network Watcher with PowerShell
64+
## <a name="powershell"></a> Create a Network Watcher using PowerShell
6265

63-
To create an instance of Network Watcher, run the following example:
66+
Use [New-AzNetworkWatcher](/powershell/module/az.network/new-aznetworkwatcher) to create an instance of Network Watcher:
6467

65-
```powershell
66-
New-AzNetworkWatcher -Name "NetworkWatcher_westcentralus" -ResourceGroupName "NetworkWatcherRG" -Location "West Central US"
68+
```azurepowershell-interactive
69+
New-AzNetworkWatcher -Name NetworkWatcher_westus -ResourceGroupName NetworkWatcherRG -Location westus
6770
```
6871

69-
## Create a Network Watcher with the Azure CLI
72+
## Create a Network Watcher using the Azure CLI
7073

71-
To create an instance of Network Watcher, run the following example:
74+
Use [az network watcher configure](/cli/azure/network/watcher#az-network-watcher-configure) to create an instance of Network Watcher:
7275

73-
```azurecli
76+
```azurecli-interactive
7477
az network watcher configure --resource-group NetworkWatcherRG --locations westcentralus --enabled
7578
```
7679

77-
## Create a Network Watcher with the REST API
80+
## <a name="restapi"></a> Create a Network Watcher using the REST API
7881

79-
The ARMclient is used to call the REST API using PowerShell. The ARMClient is found on chocolatey at [ARMClient on Chocolatey](https://chocolatey.org/packages/ARMClient)
82+
The ARMclient is used to call the [REST API](/rest/api/network-watcher/network-watchers/create-or-update) using PowerShell. The ARMClient is found on chocolatey at [ARMClient on Chocolatey](https://chocolatey.org/packages/ARMClient)
8083

81-
### Log in with ARMClient
84+
### Sign in with ARMClient
8285

8386
```powerShell
8487
armclient login
@@ -90,7 +93,7 @@ armclient login
9093
$subscriptionId = '<subscription id>'
9194
$networkWatcherName = '<name of network watcher>'
9295
$resourceGroupName = '<resource group name>'
93-
$apiversion = "2016-09-01"
96+
$apiversion = "2022-07-01"
9497
$requestBody = @"
9598
{
9699
'location': 'West Central US'
@@ -102,35 +105,48 @@ armclient put "https://management.azure.com/subscriptions/${subscriptionId}/reso
102105

103106
## Create a Network Watcher using Azure Quickstart Template
104107

105-
To create an instance of Network Watcher, refer this [Quickstart Template](https://azure.microsoft.com/resources/templates/networkwatcher-create/)
108+
To create an instance of Network Watcher, refer to this [Quickstart Template](/samples/azure/azure-quickstart-templates/networkwatcher-create).
106109

107-
## Delete a Network Watcher in the portal
110+
## Delete a Network Watcher using the Azure portal
108111

109-
1. Navigate to **All Services** > **Networking** > **Network Watcher**.
110-
2. Select the overview tab, if you're not already there. Use the dropdown to select the subscription you want to disable network watcher in.
111-
3. Expand the list of locations for your chosen subscription by selecting on the arrow. For any given, use the 3 dots on the right to access the context menu.
112-
4. Select **Disable network watcher** to start disabling. You'll be asked to confirm this step. Select **Yes** to continue.
113-
On the portal, you'll have to do this individually for every region in every subscription.
112+
1. Sign in to the [Azure portal](https://portal.azure.com) with an account that has the necessary permissions.
114113

114+
2. In the search box at the top of the portal, enter *Network Watcher*.
115115

116-
## Delete a Network Watcher with PowerShell
116+
3. In the search results, select **Network Watcher**.
117117

118-
To delete an instance of Network Watcher, run the following example:
118+
4. In the **Overview** page, select the Network Watcher instances that you want to delete, then select **Disable**.
119119

120-
```powershell
121-
New-AzResourceGroup -Name NetworkWatcherRG -Location westcentralus
122-
New-AzNetworkWatcher -Name NetworkWatcher_westcentralus -ResourceGroupName NetworkWatcherRG -Location westcentralus
123-
Remove-AzNetworkWatcher -Name NetworkWatcher_westcentralus -ResourceGroupName NetworkWatcherRG
120+
:::image type="content" source="./media/network-watcher-create/delete-network-watcher.png" alt-text="Screenshot showing how to delete a Network Watcher in the Azure portal.":::
121+
122+
5. Enter *yes*, then select **Delete**.
123+
124+
:::image type="content" source="./media/network-watcher-create/confirm-delete-network-watcher.png" alt-text="Screenshot showing the confirmation page before deleting a Network Watcher in the Azure portal.":::
125+
126+
## Delete a Network Watcher using PowerShell
127+
128+
Use [Remove-AzNetworkWatcher](/powershell/module/az.network/remove-aznetworkwatcher) to delete an instance of Network Watcher:
129+
130+
```azurepowershell-interactive
131+
Remove-AzNetworkWatcher -Name NetworkWatcher_westus -ResourceGroupName NetworkWatcherRG
132+
```
133+
134+
## Delete a Network Watcher using the Azure CLI
135+
136+
Use [az network watcher configure](/cli/azure/network/watcher#az-network-watcher-configure) to delete an instance of Network Watcher:
137+
138+
```azurecli-interactive
139+
az network watcher configure --resource-group NetworkWatcherRG --locations westcentralus --enabled false
124140
```
125141

126142
## Next steps
127143

128-
Now that you have an instance of Network Watcher, learn about the features available:
144+
Now that you have an instance of Network Watcher, learn about the available features:
129145

130-
* [Topology](./view-network-topology.md)
146+
* [Topology](view-network-topology.md)
131147
* [Packet capture](network-watcher-packet-capture-overview.md)
132148
* [IP flow verify](network-watcher-ip-flow-verify-overview.md)
133149
* [Next hop](network-watcher-next-hop-overview.md)
134150
* [Security group view](network-watcher-security-group-view-overview.md)
135151
* [NSG flow logging](network-watcher-nsg-flow-logging-overview.md)
136-
* [Virtual Network Gateway troubleshooting](network-watcher-troubleshoot-overview.md)
152+
* [Virtual Network Gateway troubleshooting](network-watcher-troubleshoot-overview.md)

0 commit comments

Comments
 (0)