Azure Monitor for Networks
“Azure Monitor Network Insights provides a comprehensive view of health and metrics for all deployed network resources, without requiring any configuration. It also provides access to network monitoring capabilities like Connection Monitor, flow logging for network security groups (NSGs), and Traffic Analytics.”
Go to “azure Portal -> Monitor -> Networks”
From here you can see your different networks and the health status of these networks.
Go to the Connectivity Tab.
There are no connection monitors here by default, you have to create them. Basically these work by setting up a source and destination, then running a number of tests between these.
EG: Your front-end web server VM communicates with a database server VM in a multi-tier application. You want to check network connectivity between the two VMs.
- Install Monitoring Agents
For connection monitors you need to install a small agent on the endpoint. This is what listens and responds to the test traffic. This can be installed on Azure VMs and on prem machines.
- Enable Network Watcher on your subscription
All subscriptions that have a virtual network are enabled with Network Watcher. When you create a virtual network in your subscription, Network Watcher is automatically enabled in the virtual network’s region and subscription.
- Create a connection monitor
The following items need to be configured in the monitor:
- Endpoint – A source or destination that participates in connectivity checks. Examples of endpoints include Azure VMs, on-premises agents, URLs, and IPs.
- Test configuration – A protocol-specific configuration for a test. Based on the protocol you chose, you can define the port, thresholds, test frequency, and other parameters.
- Test group – The group that contains source endpoints, destination endpoints, and test configurations. A connection monitor can contain more than one test group.
- Test – The combination of a source endpoint, destination endpoint, and test configuration. A test is the most granular level at which monitoring data is available. The monitoring data includes the percentage of checks that failed and the round-trip time (RTT).
Connection monitors have the following scale limits:
- Maximum connection monitors per subscription per region: 100
- Maximum test groups per connection monitor: 20
- Maximum sources and destinations per connection monitor: 100
- Maximum test configurations per connection monitor: 20
“Azure Network Watcher provides tools to monitor, diagnose, view metrics, and enable or disable logs for resources in an Azure virtual network. Network Watcher is designed to monitor and repair the network health of IaaS (Infrastructure-as-a-Service) products which includes Virtual Machines, Virtual Networks, Application Gateways, Load balancers, etc. Note: It is not intended for and will not work for PaaS monitoring or Web analytics.”
Network Watcher operates at the region level.
Monitoring Network Traffic of a VM
First we have to enable network watcher for the VM
- Go to All Services -> Network Watcher
- Go to the region where the VM is and click the 3 dots
- Click on “Enable Network watcher”
Setup “IP flow Verify”
This allows you to check if traffic to or from a VM is allowed or denied.
In this example we will check outbound TCP traffic on port 60000 to a public web server
- Set the subscription and Resource Group
- Set the VM and Nic
- Protocol: TCP
- Local IP: The private IP of the VM
- Local Port: 60000
- Remote IP address: a public webserver IP address
- Remote Port: 80
- Click on Check
- It will give the result of the check and the security rule that is effecting this.
“Packet capture is a virtual machine extension that is remotely started through Network Watcher. This capability eases the burden of running a packet capture manually on the desired virtual machine, which saves valuable time. Packet capture can be triggered through the portal, PowerShell, CLI, or REST API. One example of how packet capture can be triggered is with Virtual Machine alerts. Filters are provided for the capture session to ensure you capture traffic you want to monitor. Filters are based on 5-tuple (protocol, local IP address, remote IP address, local port, and remote port) information. The captured data is stored in the local disk or a storage blob. There is a limit of 10 packet capture sessions per region per subscription. This limit applies only to the sessions and does not apply to the saved packet capture files either locally on the VM or in a storage account.”