Create and Configure Azure Network Watcher | CodeGuru.com

Create and Configure Azure Network Watcher

An Azure network watcher is a feature in Azure that enables developers to monitor and troubleshoot applications in the Azure Virtual Network. Azure network watchers also provide tools to monitor, diagnose, view metrics, and enable (or disable) logs for resources in an Azure Virtual Network. It is designed to monitor and repair the network health […]

Written By
Tapas Pal
Tapas Pal
Jun 7, 2022
2 minute read
CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More

An Azure network watcher is a feature in Azure that enables developers to monitor and troubleshoot applications in the Azure Virtual Network. Azure network watchers also provide tools to monitor, diagnose, view metrics, and enable (or disable) logs for resources in an Azure Virtual Network. It is designed to monitor and repair the network health of IaaS (Infrastructure-as-a-Service) products, which include virtual machines, virtual networks, application gateways, load balancers, and other cloud computing resources.

In this Azure cloud development tutorial, we will create a network watcher and demonstrate its functionalities.

You can learn more about the Azure Virtual Network in ServerWatch’s guide: What is Azure VM?

How to Create Network Watcher in Azure

To begin, log in to the home page of Azure Portal and search for the phrase Azure Network Watcher.

Create an Azure network watcher

On the Network page, click Add to create a new network watcher.

Add New Network Watcher in Azure

A new network watcher will be created. Now, click on the watcher and select all of the regions you want the watcher to continuously monitor.

Azure Network Watcher options

Next, we need to deploy the network watcher and wait for the resource to be created.

Deploy an Azure Network Watcher

Once completed, go to the network watcher, as shown below:

Azure Network Watcher Deployed

View the Overview section of the network watcher, as depicted here:

Azure Network Watcher example

Use Azure Powershell to Work with Network Watchers

You can also use the Azure Powershell to work with an Azure network watcher. Once the virtual machine is created, you can use the below commands to operate the network watcher.

To enable network watcher, use the following command:

$networkWatcher = Get-AzNetworkWatcher -Name NetworkWatcher_easteurope -ResourceGroupName rgname

In the above example, you have to provide the network watcher name and resource group name.

To troubleshoot with IP Flow, developers can use the PowerShell command:

Test-AzNetworkWatcherIPFlow

The following code demonstrates how to create a network watcher from PowerShell:

$subscriptionId = ''
$networkWatcherName = ''
$resourceGroupName = ''
$apiversion = "2016-09-01"
$requestBody = @"
{
'location': 'West Central US'
}
"@
armclientput "https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.Network/networkWatchers/${networkWatcherName}?api-version=${api-version}" $requestBody

To delete a network watcher from the PowerShell, use the following command:

Remove-AzNetworkWatcher -Name NetworkWatcher_westcentralus -ResourceGroupName NetworkWatcherRG

Advertisement

Final Thoughts on Creating an Azure Network Watcher

In this Azure cloud computing tutorial, we have shown you how to create an Azure network watcher. The goal of this article was to help developers understand the basic details of Azure network watchers and how to configure them.

Read more Azure cloud computing development tutorials.

CodeGuru Logo

CodeGuru covers topics related to Microsoft-related software development, mobile development, database management, and web application programming. In addition to tutorials and how-tos that teach programmers how to code in Microsoft-related languages and frameworks like C# and .Net, we also publish articles on software development tools, the latest in developer news, and advice for project managers. Cloud services such as Microsoft Azure and database options including SQL Server and MSSQL are also frequently covered.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.