About This Page
This page is part of the Azure documentation. It contains code examples and configuration instructions for working with Azure services.
Bias Analysis
Bias Types:
⚠️
windows_first
⚠️
powershell_heavy
⚠️
windows_tools
Summary:
The documentation demonstrates a mild Windows bias by consistently presenting PowerShell (a Windows-centric tool) before Azure CLI in both prerequisites and procedural sections. PowerShell-specific instructions and terminology are detailed, and PowerShell is referenced as the method for advanced customization (e.g., naming resources), sometimes to the exclusion of CLI or Linux-native alternatives. There is no explicit mention of Linux or Bash, and no Linux-specific examples or guidance are provided, even though Azure CLI is cross-platform.
Recommendations:
- Alternate the order of PowerShell and Azure CLI sections, or present Azure CLI first in some sections to avoid the impression of Windows-first bias.
- Explicitly mention that Azure CLI commands work on Linux, macOS, and Windows, and provide Bash-specific usage notes or examples where relevant.
- Where PowerShell is referenced for advanced scenarios (e.g., custom naming), ensure equivalent Azure CLI methods are described, or clarify if not possible.
- Add a brief section or note in prerequisites highlighting that Azure CLI is available natively on Linux and macOS, and that Cloud Shell supports both Bash and PowerShell.
- Avoid language that implies PowerShell is the default or preferred scripting environment unless there is a technical reason.
Create pull request
Flagged Code Snippets
> [!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](?tabs=powershell#enable-network-watcher-for-your-region) or [REST API](/rest/api/network-watcher/network-watchers/create-or-update) 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](?tabs=portal#disable-network-watcher-for-your-region), [PowerShell](?tabs=powershell#disable-network-watcher-for-your-region), the [Azure CLI](?tabs=cli#disable-network-watcher-for-your-region), or [REST API](/rest/api/network-watcher/network-watchers/delete).
> [!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.
# [**Portal**](#tab/portal)
1. In the search box at the top of the portal, enter *network watcher*. Select **Network Watcher** from the search results.
1. On the **Overview** page, select the Network Watcher instances that you want to delete, then select **Disable**.
:::image type="content" source="./media/network-watcher-create/delete-network-watcher.png" alt-text="Screenshot shows how to delete a Network Watcher instance in the Azure portal." lightbox="./media/network-watcher-create/delete-network-watcher.png":::
1. Enter *yes*, then select **Delete**.
:::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." lightbox="./media/network-watcher-create/confirm-delete-network-watcher.png":::
# [**PowerShell**](#tab/powershell)
Delete a Network Watcher instance using [Remove-AzNetworkWatcher](/powershell/module/az.network/remove-aznetworkwatcher):
---
## Opt out of Network Watcher automatic enablement
You can opt out of Network Watcher automatic enablement using Azure PowerShell or Azure CLI.
> [!CAUTION]
> 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/).
# [**Portal**](#tab/portal)
Opting-out of Network Watcher automatic enablement isn't available in the Azure portal. Use [PowerShell](?tabs=powershell#opt-out-of-network-watcher-automatic-enablement) or [Azure CLI](?tabs=cli#opt-out-of-network-watcher-automatic-enablement) to opt out of Network Watcher automatic enablement.
# [**PowerShell**](#tab/powershell)
To opt out of Network Watcher automatic enablement, use [Register-AzProviderFeature](/powershell/module/az.resources/register-azproviderfeature) cmdlet to register the `DisableNetworkWatcherAutocreation` feature for the `Microsoft.Network` resource provider. Then, use [Register-AzResourceProvider](/powershell/module/az.resources/register-azresourceprovider) cmdlet to register the `Microsoft.Network` resource provider.
---
> [!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](#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](?tabs=portal#list-network-watcher-instances), [PowerShell](?tabs=powershell#list-network-watcher-instances), the [Azure CLI](?tabs=cli#list-network-watcher-instances), or [REST API](/rest/api/network-watcher/network-watchers/list-all) to list Network Watcher instances in your subscription.
# [**Portal**](#tab/portal)
1. In the search box at the top of the portal, enter *network watcher*. Select **Network Watcher** from the search results.
1. On the **Overview** page, you can see all Network Watcher instances in your subscription.
:::image type="content" source="./media/network-watcher-create/list-network-watcher.png" alt-text="Screenshot shows how to list all Network Watcher instances in your subscription in the Azure portal." lightbox="./media/network-watcher-create/list-network-watcher.png":::
# [**PowerShell**](#tab/powershell)
List all Network Watcher instances in your subscription using [Get-AzNetworkWatcher](/powershell/module/az.network/get-aznetworkwatcher).