Network Watcher Overview
Complete the full lesson to earn 25 points — 50 with Pro
Work through each section, then tap “Mark as Complete” on the last one.
✦ Skip the page breaks, the wait, and see fewer ads — read each lesson on a single page with Pro
Network Monitoring: An In-depth Guide to Azure Network Watcher
Introduction: The Necessity of Network Visibility
In the modern landscape of cloud computing, the network is the nervous system of your infrastructure. Whether you are running a simple web application or a complex, multi-region distributed system, the ability to observe, diagnose, and troubleshoot network traffic is not just a luxury—it is a fundamental operational requirement. Without proper monitoring, a network is a "black box" where packets disappear without explanation, latency spikes occur without warning, and security breaches go undetected until it is too late.
Azure Network Watcher serves as the primary observation deck for your virtual networks in the Microsoft cloud. It provides a suite of tools designed to help you monitor, diagnose, view metrics, and enable or disable logs for resources in an Azure virtual network. By understanding how traffic flows through your network, you can identify bottlenecks, confirm that your security rules are working as expected, and gain the granular visibility needed to maintain a high-performing environment. This lesson will guide you through the core components of Network Watcher, how to implement them effectively, and how to use these tools to maintain a secure and reliable network architecture.
Understanding the Core Components of Network Watcher
Network Watcher is not a single tool; rather, it is a collection of functional modules that work together to provide a holistic view of your network health. Understanding these components is essential for knowing which tool to reach for when a specific problem arises.
1. Topology
The Topology tool generates a visual representation of your virtual network. It shows how different resources—such as virtual machines, subnets, gateways, and network security groups—are connected to one another. This is invaluable when you are inheriting an existing environment or trying to document a complex setup that has evolved over time.
2. IP Flow Verify
When connectivity issues arise, the first question is usually: "Is a security rule blocking this traffic?" IP Flow Verify allows you to test whether a packet is allowed or denied to or from a virtual machine based on your configured Network Security Group (NSG) rules. It simulates the flow, telling you exactly which rule permitted or denied the traffic.
3. Next Hop
In complex networks with user-defined routes, understanding how a packet gets from point A to point B can be confusing. Next Hop tells you the next destination for a packet originating from a virtual machine. It identifies whether the traffic is going to the internet, a virtual appliance, a gateway, or another subnet, which is essential for troubleshooting routing loops or misconfigured traffic paths.
4. Connection Monitor
While other tools provide point-in-time snapshots, Connection Monitor provides continuous, end-to-end monitoring. It tracks connectivity between two endpoints (e.g., between two virtual machines or a virtual machine and an external URL) and reports on latency, jitter, and packet loss over time.
5. Packet Capture
Sometimes, you need to see exactly what is inside the traffic. Packet Capture allows you to initiate a capture session on a virtual machine, storing the packet data in a storage account or on the local disk. This is the ultimate tool for deep-dive forensics or debugging application-level protocols.
Callout: Diagnostic Tools vs. Continuous Monitoring It is important to distinguish between tools used for troubleshooting (like IP Flow Verify) and tools used for observability (like Connection Monitor). Diagnostic tools are reactive; you use them when something breaks. Observability tools are proactive; they tell you when something is about to break or has degraded in performance. A mature network strategy requires both.
Implementing Network Watcher: Step-by-Step
Before you can use these tools, you must ensure the Network Watcher service is enabled in your region. By default, Azure creates a Network Watcher instance in every region where you have a virtual network, but you should always verify this status.
Enabling Network Watcher
- Navigate to the Azure Portal and search for "Network Watcher."
- Select the "Overview" blade.
- You will see a list of regions. If the status is "Disabled," click the ellipsis (...) next to the region and select "Enable Network Watcher."
Using IP Flow Verify for Troubleshooting
Imagine a scenario where an application server cannot reach a database. Follow these steps to diagnose:
- In the Network Watcher menu, select "IP Flow Verify."
- Choose the resource group and the virtual machine in question.
- Select the network interface (NIC) associated with the VM.
- Define the protocol (TCP/UDP), direction (Inbound/Outbound), local IP, and remote IP/port.
- Click "Verify."
The tool will return a status of "Access Allowed" or "Access Denied." If it is denied, it will explicitly name the NSG rule responsible for the block. This eliminates guesswork and allows you to modify the rule immediately.
Configuring Connection Monitor
To set up a continuous monitor between a client VM and a web service:
- Select "Connection Monitor" in the Network Watcher blade.
- Click "Create."
- Define the source (the VM) and the destination (the external URL or another VM).
- Set the monitoring frequency (e.g., every 60 seconds).
- Review and create.
Once active, the dashboard will display a heatmap of connectivity. If latency spikes, you can drill down into the hop-by-hop analysis to see if the delay is occurring within your VNet or on the path to the internet.
Practical Examples and Code Snippets
While the Portal is excellent for ad-hoc tasks, automation is the standard for production environments. You can use Azure CLI or PowerShell to trigger these diagnostics programmatically.
Example: Checking Connectivity via Azure CLI
If you are managing your infrastructure as code, you can run a quick connectivity check using the following command:
az network watcher test-connectivity \
--resource-group MyResourceGroup \
--location eastus \
--source-resource /subscriptions/{sub-id}/resourceGroups/MyRG/providers/Microsoft.Compute/virtualMachines/MyVM \
--dest-address 10.0.0.5 \
--dest-port 80 \
--protocol TCP
Explanation of the code:
source-resource: Specifies the fully qualified ID of the VM starting the probe.dest-address: The IP address you are trying to reach.dest-port: The specific port for the application service.protocol: Essential, as TCP and UDP are handled differently by firewalls.
This output will return a JSON object detailing the hops taken and whether the connection was successful. This is incredibly useful for CI/CD pipelines where you might want to verify network reachability after a deployment.
Example: Initiating a Packet Capture
Packet capture can be resource-intensive, so it should be used sparingly. Here is how to start one via CLI:
az network watcher packet-capture create \
--resource-group MyResourceGroup \
--vm MyVM \
--name MyCaptureSession \
--storage-account MyStorageAccountName \
--time-limit 600
Explanation of the code:
time-limit: Set this to prevent the capture from running indefinitely, which would consume your storage costs and potentially impact VM performance.storage-account: Captured data is saved as a.capfile here, which you can later download and open in tools like Wireshark for analysis.
Note: Always remember to delete your packet capture sessions once you have gathered the necessary data. Leaving them running can lead to significant storage costs and, in rare cases, performance degradation on the virtual machine due to high disk I/O.
Best Practices for Network Monitoring
Monitoring is not a "set it and forget it" task. To get the most out of Network Watcher, follow these industry-standard practices.
1. Establish a Baseline
You cannot identify an anomaly if you do not know what "normal" looks like. Use Connection Monitor for at least two weeks to gather data on typical latency and throughput. Once you have a baseline, you can set alerts for deviations (e.g., "Alert me if latency exceeds 50ms for more than 5 minutes").
2. Use Network Security Group (NSG) Flow Logs
While IP Flow Verify is for testing, NSG Flow Logs provide a historical record of all traffic passing through your NSGs. Enable these logs and stream them to a Log Analytics workspace. This allows you to run Kusto Query Language (KQL) queries to look for patterns, such as an unusual amount of traffic from a specific IP range, which might indicate a brute-force attack.
3. Implement Least Privilege
Network Watcher provides visibility into your network configuration. Ensure that only authorized personnel have access to run packet captures or view flow logs. Use Azure Role-Based Access Control (RBAC) to restrict these permissions to network administrators.
4. Optimize for Cost
Azure Network Watcher has costs associated with data ingestion and storage, particularly for Packet Capture and Flow Logs. Be intentional about which subnets you monitor. Do not enable verbose logging on every single interface if it is not required for compliance or troubleshooting.
Common Pitfalls and How to Avoid Them
Even experienced engineers fall into traps when setting up network monitoring. Here are the most frequent mistakes:
The "All-or-Nothing" Trap
Many teams try to monitor every single packet on every single interface. This creates "alert fatigue," where the sheer volume of data makes it impossible to find the signal in the noise.
- The Fix: Start by monitoring critical path traffic—the connections between your web tier, app tier, and database tier. Expand to less critical segments only as needed.
Ignoring Local Firewall Rules
Sometimes, IP Flow Verify shows that traffic is allowed by the NSG, but the connection still fails.
- The Fix: Remember that the NSG is a layer of the security stack. The virtual machine's OS-level firewall (like
iptableson Linux or Windows Firewall) might still be blocking the traffic. Always check the OS firewall if the NSG check returns "Allowed."
Forgetting to Clean Up
As mentioned earlier, packet captures and diagnostic logs can accumulate.
- The Fix: Implement Azure Policy to automatically tag resources and enforce retention periods for storage accounts used by Network Watcher.
Warning: Performance Impact of Packet Capture While modern Azure VMs are highly capable, running a packet capture on a high-traffic production server can introduce latency or CPU overhead. Always perform packet captures during off-peak hours if possible, and keep the duration as short as possible to capture only the specific event you are investigating.
Comparison Table: Network Watcher Tools
| Tool | Primary Use Case | Proactive/Reactive |
|---|---|---|
| Topology | Visualizing network architecture | Informational |
| IP Flow Verify | Troubleshooting specific connectivity | Reactive |
| Next Hop | Routing and path analysis | Reactive |
| Connection Monitor | Continuous health monitoring | Proactive |
| Packet Capture | Deep forensics/debugging | Reactive |
| NSG Flow Logs | Auditing and traffic analysis | Proactive/Reactive |
Advanced Deep-Dive: Troubleshooting Routing Issues
One of the most common issues in enterprise clouds is the "asymmetric routing" problem. This happens when traffic takes one path to reach a destination but attempts to return via a different path, causing firewalls or load balancers to drop the packet because they do not have a record of the original request.
Identifying Routing Problems with Next Hop
If you suspect an asymmetric route, the Next Hop tool is your best friend. Follow these steps:
- Run
Next Hopfrom the source VM toward the destination. - Note the "Next Hop Type." If it says
VirtualAppliance, ensure that your appliance is configured to handle the return traffic. - If you have User Defined Routes (UDRs), check the route table associated with the subnet. Often, a typo in a UDR (e.g., a wrong IP for the next hop) is the culprit.
Using KQL for Network Insights
If you have enabled NSG Flow Logs, you can use KQL in Azure Monitor to gain powerful insights. For example, to see which IPs are attempting to connect to your database over a restricted port, use:
AzureNetworkAnalytics_CL
| where DestPort_d == 1433
| summarize count() by SrcIP_s, Action_s
| sort by count_ desc
This query summarizes traffic to the SQL port (1433) and groups it by source IP, making it trivial to spot potential unauthorized scanning or brute-force attempts.
Security Implications of Network Watcher
Network Watcher is not just a tool for availability; it is a critical component of your security posture. By monitoring traffic patterns, you can detect anomalies that signature-based systems might miss.
Detecting Exfiltration
If a server in your environment suddenly starts sending large amounts of data to an unknown external IP, Network Watcher (via Flow Logs) will capture this. By setting up alerts on "Flow Log" data, you can trigger an automated response, such as disabling the network interface of the suspicious VM or revoking the identity of the service principal running on that VM.
Compliance Auditing
Many regulatory frameworks, such as PCI-DSS or HIPAA, require that you maintain logs of who accessed what data. Network Watcher provides the necessary audit trail for network-level access. By archiving these logs in a write-once-read-many (WORM) storage account, you can satisfy auditors that your network traffic is being monitored and recorded according to industry standards.
Managing Network Watcher at Scale
When you manage hundreds of VNets across multiple subscriptions, you cannot manually configure Network Watcher for each one. This is where Infrastructure as Code (IaC) becomes non-negotiable.
Using Azure Policy
You should deploy an Azure Policy that mandates the deployment of Network Watcher for any new VNet created in your organization. This ensures that your security and operations teams have immediate visibility into new infrastructure without needing to remember to enable it manually.
Centralized Logging
Instead of having logs scattered across individual storage accounts, configure your environment to stream all NSG Flow Logs and diagnostic data into a single, centralized Log Analytics workspace. This allows for cross-subscription analysis, which is vital for security teams who need to see the "big picture" of the entire organization's network perimeter.
FAQ: Common Questions About Network Watcher
Q: Does Network Watcher cost money even if I am not using it? A: No, you are generally charged based on the features you use. For example, you only pay for the data stored in packet captures or the amount of flow logs processed. Simply enabling the service in a region does not incur a significant cost.
Q: Can I use Network Watcher to monitor resources in other clouds? A: Network Watcher is specific to Azure resources. To monitor hybrid or multi-cloud environments, you would typically use a combination of Azure Network Watcher for your Azure footprint and a third-party observability platform to aggregate data across environments.
Q: Is the data from Network Watcher real-time? A: Most features provide near-real-time data. However, Flow Logs may have a slight delay (typically 5-15 minutes) before they appear in your workspace, so they should not be used for emergency, millisecond-level incident response.
Q: What is the difference between Network Watcher and Azure Firewall logs? A: Network Watcher focuses on the virtual network and the connectivity between resources. Azure Firewall logs are specific to the traffic passing through the Azure Firewall service. They complement each other; use Network Watcher for VNet-wide visibility and Azure Firewall logs for traffic inspected by your perimeter security.
Key Takeaways
As we conclude this lesson, remember that network monitoring is about achieving clarity in a complex environment. Use the following points as your guiding principles for maintaining a robust network:
- Visibility First: Never treat your network as a black box. Use the Topology tool to understand your layout and keep it documented.
- Proactive vs. Reactive: Use Connection Monitor to proactively alert you to performance degradation, and use IP Flow Verify and Next Hop to reactively solve connectivity issues.
- Automate Everything: Use Azure CLI, PowerShell, and Azure Policy to ensure that monitoring is consistently applied across your entire environment.
- Log with Purpose: Do not log everything. Enable NSG Flow Logs for critical subnets and use KQL to surface meaningful patterns rather than drowning in raw data.
- Security Integration: Treat network logs as security logs. Integrate them with your SIEM (Security Information and Event Management) system to detect threats.
- Cost Awareness: Be mindful of the storage and ingestion costs associated with logging and packet captures. Clean up after your investigations.
- The Human Factor: Tools are only as good as the people who use them. Train your team to interpret the output of these tools—understanding why a packet was denied is far more valuable than simply knowing it was.
By mastering Azure Network Watcher, you transition from being a passive observer of your network to an active steward. This capability is what separates high-performing, resilient infrastructure teams from those that are constantly putting out fires. Start small, build your baselines, and continue to refine your monitoring strategy as your network grows.
Reach the last section to complete this lesson and earn points — you're on section 1 of 11.
- Introduction to Azure Networking
- Introduction to Azure Networking Quiz5q
- Virtual Network Address Spaces
- Virtual Network Address Spaces Quiz5q
- Subnet Design and Configuration
- Subnet Design and Configuration Quiz5q
- Public and Private IP Addressing
- Public and Private IP Addressing Quiz5q
- Network Interface Configuration
- Network Interface Configuration Quiz5q
- Azure DNS Configuration
- Azure DNS Configuration Quiz5q
- Virtual Network Peering
- Virtual Network Peering Quiz5q
- Global VNet Peering
- Global VNet Peering Quiz5q
- Azure Virtual WAN
- Azure Virtual WAN Quiz5q
- Virtual WAN Hub Configuration
- Virtual WAN Hub Configuration Quiz5q
- Service Chaining and UDR
- Service Chaining and UDR Quiz5q
- Network Virtual Appliances
- Network Virtual Appliances Quiz5q
- Azure VPN Gateway Overview
- Azure VPN Gateway Overview Quiz5q
- Site-to-Site VPN Configuration
- Site-to-Site VPN Configuration Quiz5q
- Point-to-Site VPN Configuration
- Point-to-Site VPN Configuration Quiz5q
- VPN Gateway SKUs and Sizing
- VPN Gateway SKUs and Sizing Quiz5q
- VPN Gateway High Availability
- VPN Gateway High Availability Quiz5q
- VPN Gateway Troubleshooting
- VPN Gateway Troubleshooting Quiz5q
- ExpressRoute Overview
- ExpressRoute Overview Quiz5q
- ExpressRoute Circuit Configuration
- ExpressRoute Circuit Configuration Quiz5q
- ExpressRoute Peering Types
- ExpressRoute Peering Types Quiz5q
- ExpressRoute Global Reach
- ExpressRoute Global Reach Quiz5q
- ExpressRoute FastPath
- ExpressRoute FastPath Quiz5q
- ExpressRoute High Availability
- ExpressRoute High Availability Quiz5q
- Azure Load Balancer Overview
- Azure Load Balancer Overview Quiz5q
- Internal Load Balancer Configuration
- Internal Load Balancer Configuration Quiz5q
- Public Load Balancer Configuration
- Public Load Balancer Configuration Quiz5q
- Load Balancer Health Probes
- Load Balancer Health Probes Quiz5q
- Cross-Region Load Balancer
- Cross-Region Load Balancer Quiz5q
- Application Gateway Overview
- Application Gateway Overview Quiz5q
- Application Gateway Components
- Application Gateway Components Quiz5q
- URL Path-Based Routing
- URL Path-Based Routing Quiz5q
- Multi-Site Hosting
- Multi-Site Hosting Quiz5q
- SSL Termination and End-to-End SSL
- SSL Termination and End-to-End SSL Quiz5q
- Web Application Firewall Integration
- Web Application Firewall Integration Quiz5q
Enjoying the courses?
Everything stays free. Pro shows fewer ads, doubles the points you earn on every lesson and quiz so you progress twice as fast, unlocks half of every practice exam — plus full case studies — with the Learn & Exam study modes, and lets you read each lesson on one page.
- ✓ Fewer advertisements
- ✓ 2× points per lesson & quiz
- ✓ 50% of every exam unlocked
- ✓ Learn & Exam modes
- ✓ Distraction-free lessons