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
- An active Azure subscription.
- Azure CLI installed (az version >= 2.30.0).
- Permission to create resources in the target resource group.
Step 1 – Create a Resource Group
az group create --name MyConnectionMonitorRG --location eastusStep 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/24Step 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 30Step 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 MyConnMonitorLive Demo
Enter the resource ID and destination you want to monitor: