Lesson 22 — Azure Site Recovery & Network Watcher
Why You Need This
Azure Backup recovers from data loss — a deleted file, a corrupted database, an accidental VM deletion. Azure Site Recovery answers a harder question: what happens if the entire Azure region goes down? ASR continuously replicates your VMs to a secondary region so that a regional failure becomes a planned failover with minutes of downtime rather than a catastrophic loss.
Network Watcher completes the operational picture. Once your infrastructure is running and protected, you need tools to diagnose network issues in real time. NSG flow analysis, routing verification, and end-to-end connectivity monitoring are all in Network Watcher's toolbox — and several of these tools appear directly in AZ-104 scenario questions.
Part 1 — Azure Site Recovery
ASR purpose and positioning
Azure Site Recovery (ASR) is Azure's Disaster Recovery (DR) service. It continuously replicates Azure VMs (or on-premises VMs and physical servers) to a secondary Azure region, enabling failover with near-zero data loss when the primary region becomes unavailable.
| Azure Backup | Azure Site Recovery | |
|---|---|---|
| Purpose | Operational recovery — restore from accidental deletion, corruption, ransomware | Disaster recovery — survive regional outages |
| RPO | Up to 24 hours (daily backup frequency) | As low as seconds (crash-consistent); ~1 hour (app-consistent) |
| RTO | Minutes (instant restore) to hours (vault restore, large disks) | Minutes (failover starts VMs in secondary region) |
| Replication | Scheduled snapshots | Continuous, near-real-time disk change replication |
| Target | Recovery Services Vault | Secondary Azure region (or secondary site) |
| Vault type | Recovery Services Vault | Also uses Recovery Services Vault — but as an ASR vault, not a backup vault |
How Azure-to-Azure ASR Works
Architecture components
When you enable replication for an Azure VM, ASR creates and manages several resources automatically:
Replication flow
- The Mobility Service agent is installed on the source VM (ASR installs it automatically when you enable replication). It intercepts all disk writes.
- Changes are written to a cache storage account in the source region.
- ASR reads from the cache and asynchronously replicates changes to the replica managed disks in the target region.
- ASR creates recovery points at defined intervals: crash-consistent every 5 minutes, app-consistent (VSS) every 1 hour (configurable in the replication policy).
- The replica VM exists in the target region but is in a stopped/deallocated state — you pay for disk storage but not compute until failover.
Replication Policy
The replication policy controls how ASR creates and manages recovery points. Key parameters:
| Parameter | Default | Range | Notes |
|---|---|---|---|
| RPO warning threshold | 30 minutes | Minutes | Alert fires if replication lag exceeds this threshold — does not stop replication |
| Crash-consistent recovery point | Every 5 minutes | Fixed | Always retained; frequency is not configurable |
| App-consistent recovery point frequency | Every 4 hours | 1–12 hours | Uses VSS — higher frequency increases performance impact on source VM |
| Recovery point retention | 24 hours | Up to 72 hours | How far back you can failover to — the history of recovery points retained |
Failover Types
ASR provides three distinct failover operations, each appropriate for different scenarios. Choosing the wrong one in a real incident can cause unnecessary data loss or disrupt the production environment.
| Failover type | Source VM state | Data loss | When to use |
|---|---|---|---|
| Test Failover | Continues running — not affected | None (test network is isolated) | DR drills, compliance validation, verifying the DR plan. Always test before a real incident. |
| Planned Failover | Must be shut down before failover | Zero — replication fully synchronises before failover | Planned maintenance, region migrations, or any scenario where you control the timing |
| Unplanned Failover | Unavailable (region down) | Potential loss up to the last recovery point | Actual disaster — the primary region is unavailable and you must fail over immediately |
Failover process for unplanned failover
- In the ASR vault, navigate to Replicated items → select the VM → Failover
- Choose the recovery point to fail over to (latest processed, latest app-consistent, or a specific point in time)
- Confirm you want to shut down the source VM before failover (if still accessible)
- ASR starts the replica VM in the target region and connects it to the target VNet (via network mapping)
- Update DNS to point at the new VM's IP address in the target region
- Validate the application in the target region
- Click "Commit" to finalise the failover — this discards old recovery points and severs the relationship with the source
Failback and Recovery Plans
Failback
After a failover, your production workload is now running in the secondary region. Once the primary region is restored and stable, you fail back: you reverse-replicate from the secondary region back to the primary, then perform a planned failover back to primary. ASR supports this reprotect and failback workflow natively.
Recovery plans
A recovery plan orchestrates the failover of a multi-VM application in a defined sequence with automated steps between groups. This is essential for multi-tier applications where the order of failover matters.
For a classic 3-tier web application, the recovery plan sequence would be:
Recovery plans can include:
- Azure Automation runbooks — for complex pre/post steps (update DNS, warm up caches, disable traffic manager endpoints)
- Manual action steps — checkpoints requiring human confirmation before proceeding
- Wait steps — timed delays between groups
RTO and RPO for ASR
| Metric | Value for ASR | Notes |
|---|---|---|
| RPO | Typically 15–30 seconds for crash-consistent; up to 1 hour for app-consistent | Measured from last recovery point to failover time. Not the same as replication lag — actual RPO depends on how recently a recovery point was created. |
| RTO | Minutes for the VM to start; additional time for DNS propagation and application warm-up | VM start time is typically 1–5 minutes. Total application RTO depends on application startup time and DNS TTL. |
Part 2 — Azure Network Watcher
What is Network Watcher?
Azure Network Watcher is a regional service providing monitoring, diagnostics, and logging capabilities for Azure virtual networks. It must be enabled per region — it is not a global service. When you create a VNet in a region, Azure often auto-enables Network Watcher for that region, but it is best practice to verify this explicitly.
NetworkWatcherRG resource group.
Network Watcher Tools Reference
| Tool | What it does | When to use it |
|---|---|---|
| IP Flow Verify | Tests whether a specific traffic flow (source IP, source port, destination IP, destination port, protocol, direction) would be allowed or denied by the NSG rules on a VM's NIC. Returns the specific NSG rule responsible for the decision. | First-line NSG troubleshooting. "Why can't I connect to port 443 on this VM?" — run IP Flow Verify before reading NSG rules manually. |
| Next Hop | Shows the effective next hop for traffic leaving a VM toward a destination IP — based on system routes, UDRs (User-Defined Routes), and BGP routes. Returns hop type (VirtualNetworkGateway, Internet, VirtualAppliance, None) and the route table entry. | Diagnosing routing issues. "Traffic should go through the firewall NVA but it's being dropped." — Next Hop reveals if a UDR is sending it to None (blackhole) instead. |
| Effective Security Rules | Displays the merged, prioritised list of NSG rules actually applied to a VM's NIC — combining both the NIC-level NSG and the subnet-level NSG in effective order. | Understanding the full security posture of a VM when multiple NSGs are applied. Covered extensively in Lesson 15. |
| VPN Diagnostics | Runs diagnostics against a VPN Gateway or VPN connection. Checks IKE negotiation logs, tunnel status, and BGP routes. Results are stored in a Storage Account blob. | VPN tunnel is down or flapping. Connection is established but BGP routes are not being exchanged. |
| Connection Monitor | Continuously monitors TCP/HTTP connectivity between a source endpoint (Azure VM, on-premises agent) and a destination (VM, URL, IP address). Provides reachability status, round-trip latency, topology view, and alert integration. Tests run on a configurable schedule. | Ongoing SLA monitoring for critical connections. Validates private endpoint connectivity. Tests cross-region reachability. Provides latency baselines and alerts when connectivity degrades. |
| Packet Capture | Captures network packets from a VM's NIC to a Storage Account blob or local file. No agent installation required — done at the Azure host level via a VM extension. Supports capture filters (IP, port, protocol). | Deep packet analysis for unexplained application failures. Protocol debugging when higher-level tools are inconclusive. Requires a storage account to store captures. |
| NSG Flow Logs | Enables per-NSG logging of every allowed and denied connection (5-tuple: source IP, source port, destination IP, destination port, protocol) to a Storage Account. V2 logs also include bytes and packet counts. Managed through Network Watcher in the portal. | Security audit trails. Traffic volume analysis. Identifying which IPs are communicating with which resources. Required input for Traffic Analytics. |
| Traffic Analytics | Processes NSG Flow Logs through a Log Analytics workspace to produce visualised dashboards: top talkers, allowed vs. denied flow distribution, geo-mapped traffic origins, hot spots, and anomaly detection. | Macro-level network traffic visibility. Security reviews. Identifying unexpected cross-region traffic or public internet ingress patterns at scale. |
IP Flow Verify — The NSG Diagnostic Tool
IP Flow Verify is the most frequently used Network Watcher tool for day-to-day Azure administration. It answers the exact question NSG troubleshooting always starts with: "Is this specific connection being blocked, and by which rule?"
How to use it
In the Azure portal, navigate to Network Watcher → IP Flow Verify, then specify:
- Subscription, Resource Group, VM, NIC: the target VM's network interface
- Direction: Inbound or Outbound
- Protocol: TCP or UDP
- Local port: the port on the VM's NIC
- Remote IP address: source IP (inbound) or destination IP (outbound)
- Remote port: source port (inbound) or destination port (outbound)
IP Flow Verify evaluates the effective NSG rules (NIC-level and subnet-level) and returns:
- Access: Allow or Deny
- Rule name: the specific NSG rule that made the decision (e.g.
DenyAllInbound,Port_8080) - NSG name and resource group: which NSG contains the rule
Next Hop — Routing Diagnostics
Next Hop diagnoses routing issues by showing the effective route for a specific source VM and destination IP combination. Azure evaluates system routes, UDRs, and BGP-advertised routes to determine the effective next hop.
Common Next Hop types and what they mean
| Next Hop type | Meaning | Typical scenario |
|---|---|---|
Internet |
Traffic exits to the public internet via Azure's default internet gateway | Expected for public endpoint destinations |
VirtualNetwork |
Traffic stays within the VNet (direct routing to another VM in the same VNet) | Expected for intra-VNet communication |
VirtualNetworkGateway |
Traffic is routed through a VPN or ExpressRoute Gateway | Expected for on-premises bound traffic via S2S VPN |
VirtualAppliance |
Traffic is directed to a Network Virtual Appliance (NVA) — Azure Firewall or third-party firewall VM | Expected in hub-spoke topologies with forced tunnelling |
None |
No valid route — traffic is blackholed and dropped | Problem indicator — a misconfigured UDR is sending traffic to a non-existent next hop |
None, traffic to that destination is silently dropped. This is almost always caused by a UDR that routes traffic to a next hop IP address that is unreachable, deleted, or on a deallocated NVA. Fix the UDR to point to the correct NVA IP, or delete the UDR to fall back to system routes.
Connection Monitor — Continuous Connectivity Testing
Connection Monitor is distinct from the point-in-time diagnostic tools (IP Flow Verify, Next Hop). It runs continuously on a schedule, testing TCP or HTTP connectivity between defined source and destination endpoints. This makes it appropriate for ongoing SLA validation, not just one-time troubleshooting.
Connection Monitor architecture
- Sources: Azure VMs with the Network Watcher agent extension installed, or on-premises machines with the Log Analytics agent
- Destinations: Azure VMs (by NIC), Azure service endpoints, public URLs, or IP addresses with specific ports
- Test frequency: every 30 seconds to 5 minutes
- Metrics collected: checks failed (%), round-trip latency (ms), topology path
Use cases
- Private endpoint validation: continuously prove that your Azure SQL private endpoint is reachable from the application subnet — and alert immediately if it is not
- Cross-region reachability: verify that VNet peering between East US and West US is operational
- Baseline SLA monitoring: document the normal latency between your app tier and database tier, and alert when it exceeds threshold
- Third-party SaaS connectivity: continuously verify outbound connectivity to external APIs from your VMs
NSG Flow Logs and Traffic Analytics
NSG Flow Logs and Traffic Analytics form a traffic observability pipeline. They were covered in Lesson 15 from an NSG perspective — here we focus on the Network Watcher management layer.
NSG Flow Logs
Enable per NSG. Each allowed or denied connection generates a log entry containing the 5-tuple (source IP, source port, destination IP, destination port, protocol), direction, action, and (in V2) byte and packet counts. Logs are written to a Storage Account in JSON format.
Version 2 is the current standard — it adds throughput data (bytes/packets) that V1 lacks. Always configure V2 for new deployments.
Traffic Analytics
Traffic Analytics processes NSG Flow Log data through Log Analytics to produce visualised intelligence. It aggregates flows at configurable intervals (10 or 60 minutes) and produces:
- Top talkers (source/destination pairs by volume)
- Geo-mapped traffic origin dashboards
- Allowed vs. denied flow ratios
- Hot spots — workloads receiving the most traffic
- Malicious IP detection via Microsoft Threat Intelligence integration
Check Your Understanding
Click any option to see immediate feedback.
1. A critical application with an RPO requirement of 2 minutes is running on Azure VMs. Which service is the correct solution?
2. Your team wants to run a DR drill to validate the ASR failover configuration without affecting production workloads or the ongoing replication process. Which failover type should you use?
3. You are configuring ASR for a 3-tier application: web servers, application servers, and SQL Server. How do you ensure that during failover, the SQL Server VMs are started before the application servers, and application servers before the web servers?
4. An engineer reports they cannot connect from their VM (10.1.0.4) to a web server VM (10.1.1.10) on port 443. You need to quickly determine whether an NSG rule is blocking the connection and which rule it is. Which Network Watcher tool do you use?
5. Traffic from an application VM is not reaching the Azure Firewall NVA as expected — it appears to be going directly to the internet instead. Which Network Watcher tool identifies the cause?
6. You need to continuously monitor the TCP connectivity between your application VMs in East US and your Azure SQL private endpoint, with automatic alerting if connectivity drops and SLA reporting over 30 days. Which tool provides this?
For Network Watcher, the companion reference is the Azure Network Watcher overview. Walk through the IP Flow Verify and Next Hop quickstarts in the portal against a test VM — these tools require hands-on practice to develop the muscle memory for real incident response.
This lesson covered ASR for disaster recovery and Network Watcher for network diagnostics. Go deeper on:
- Walk me through the complete ASR setup process for an Azure-to-Azure replication, including pre-creating target VNets and configuring network mapping.
- What is the difference between crash-consistent and app-consistent recovery points in ASR, and how do I tune the replication policy for a SQL Server workload?
- How do I configure Traffic Analytics to identify unexpected internet ingress flows across all VNets in my subscription?
- Can I use ASR to migrate a VM from one Azure region to another permanently, and if so, what is the migration procedure vs. a DR failover?