Azure Azure Documentation

Getting Started with Azure Connection Monitor

Azure Connection Monitor provides real‑time network health monitoring for your virtual networks, VPNs, and ExpressRoute circuits. Follow the steps below to set up a basic Connection Monitor instance using Azure CLI.

Prerequisites

Step 1 – Create a Resource Group

az group create --name MyConnectionMonitorRG --location eastus

Step 2 – Deploy a Virtual Network (Optional)

If you don't already have a virtual network, create one:

az network vnet create \
  --resource-group MyConnectionMonitorRG \
  --name MyVNet \
  --address-prefix 10.0.0.0/16 \
  --subnet-name MySubnet \
  --subnet-prefix 10.0.1.0/24

Step 3 – Create a Connection Monitor

Replace <source-resource-id> and <destination-ip> with your own identifiers.

az network watcher connection-monitor create \
  --resource-group MyConnectionMonitorRG \
  --name MyConnMonitor \
  --location eastus \
  --src-resource /subscriptions/{sub-id}/resourceGroups/MyConnectionMonitorRG/providers/Microsoft.Network/networkInterfaces/MyVMNic \
  --dest-address 8.8.8.8 \
  --dest-port 53 \
  --protocol Tcp \
  --monitoring-interval 30

Step 4 – View Monitoring Results

Open the Azure portal or use the CLI to retrieve the latest results:

az network watcher connection-monitor show \
  --resource-group MyConnectionMonitorRG \
  --name MyConnMonitor

Live Demo

Enter the resource ID and destination you want to monitor: