Azure 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 in an Azure region through the creation of a Network Watcher instance in that region. This instance allows you to utilize Network Watcher capabilities in that particular region.
Note
By default, Network Watcher is automatically enabled. When you create or update a virtual network in your subscription, Network Watcher will be automatically enabled in your Virtual Network's region.
Automatically enabling Network Watcher doesn't affect your resources or associated charge.
The steps in this article run the Azure PowerShell cmdlets interactively in Azure Cloud Shell. To run the commands in the Cloud Shell, select Open Cloud Shell at the upper-right corner of a code block. Select Copy to copy the code and then paste it into Cloud Shell to run it. You can also run the Cloud Shell from within the Azure portal.
The steps in this article run the Azure CLI commands interactively in Azure Cloud Shell. To run the commands in the Cloud Shell, select Open Cloud Shell at the upper-right corner of a code block. Select Copy to copy the code, and paste it into Cloud Shell to run it. You can also run the Cloud Shell from within the Azure portal.
You can also install Azure CLI locally to run the commands. To find the installed version, run az version command. If you run Azure CLI locally, sign in to Azure using the az login command.
In the search box at the top of the portal, enter network watcher. Select Network Watcher from the search results.
On the Overview page, select + Create.
On Add network watcher, select your Azure subscription, then select the region that you want to enable Azure Network Watcher for.
Select Add.
Note
When you create a Network Watcher instance using the Azure portal:
The name of the Network Watcher instance is automatically set to NetworkWatcher_region, where region 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.
The Network Watcher instance is created in a resource group named NetworkWatcherRG. The resource group is created if it doesn't already exist.
If you wish to customize the name of a Network Watcher instance and resource group, you can use PowerShell or REST API methods. In each option, the resource group must exist before you create a Network Watcher in it.
# Create a resource group for the Network Watcher instance (if it doesn't already exist).
New-AzResourceGroup -Name 'NetworkWatcherRG' -Location 'eastus'
# Create an instance of Network Watcher in East US region.
New-AzNetworkWatcher -Name 'NetworkWatcher_eastus' -ResourceGroupName 'NetworkWatcherRG' -Location 'eastus'
Note
When you create a Network Watcher instance using PowerShell, you can customize the name of a Network Watcher instance and resource group. However, the resource group must exist before you create a Network Watcher instance in it.
# Create a resource group for the Network Watcher instance (if it doesn't already exist).
az group create --name 'NetworkWatcherRG' --location 'eastus'
# Create an instance of Network Watcher in East US region.
az network watcher configure --resource-group 'NetworkWatcherRG' --locations 'eastus' --enabled
Note
When you create a Network Watcher instance using the Azure CLI:
The name of the Network Watcher instance is automatically set to region-watcher, where region corresponds to the Azure region of the Network Watcher instance. For example, a Network Watcher enabled in the East US region is named eastus-watcher.
You can customize the name of the Network Watcher resource group. However, the resource group must exist before you create a Network Watcher instance in it.
If you wish to customize the name of the Network Watcher instance, you can use PowerShell or REST API methods.
Disable Network Watcher for your region
You can disable Network Watcher for a region by deleting the Network Watcher instance in that region. You can delete a Network Watcher instance using the Azure portal, PowerShell, the Azure CLI, or REST API.
Warning
Deleting a Network Watcher instance deletes all Network Watcher running operations, historical data, and alerts with no option to revert. For example, if you delete NetworkWatcher_eastus instance, all flow logs, connection monitors and packet captures in East US region will be deleted.
Opting-out of Network Watcher automatic enablement isn't available in the Azure portal. Use PowerShell or Azure CLI to opt out of Network Watcher automatic enablement.
To opt out of Network Watcher automatic enablement, use Register-AzProviderFeature cmdlet to register the DisableNetworkWatcherAutocreation feature for the Microsoft.Network resource provider. Then, use Register-AzResourceProvider cmdlet to register the Microsoft.Network resource provider.
# Register the "DisableNetworkWatcherAutocreation" feature.
Register-AzProviderFeature -FeatureName 'DisableNetworkWatcherAutocreation' -ProviderNamespace 'Microsoft.Network'
# Register the "Microsoft.Network" resource provider.
Register-AzResourceProvider -ProviderNamespace 'Microsoft.Network'
To opt out of Network Watcher automatic enablement, use az feature register command to register the DisableNetworkWatcherAutocreation feature for the Microsoft.Network resource provider. Then, use az provider register command to register the Microsoft.Network resource provider.
# Register the "DisableNetworkWatcherAutocreation" feature.
az feature register --name 'DisableNetworkWatcherAutocreation' --namespace 'Microsoft.Network'
# Register the "Microsoft.Network" resource provider.
az provider register --name 'Microsoft.Network'
Note
After you opt out of Network Watcher automatic enablement, you must manually enable Network Watcher in each region where you want to use Network Watcher capabilities. For more information, see Enable Network Watcher for your region.
List Network Watcher instances
You can view all regions where Network Watcher is enabled in your subscription by listing available Network Watcher instances in your subscription. Use the Azure portal, PowerShell, the Azure CLI, or REST API to list Network Watcher instances in your subscription.