Study guide
10.2 NSG Flow Logs, VNet Flow Logs & Traffic Analytics
Designing and Implementing Microsoft Azure Networking Solutions AZ-700
Track your progress as you read
Finished sections get a check mark.
1 Introduction & AZ-700 Exam Overview
0.1 About the AZ-700 Exam: Format, Scoring & Skills Measured
2 Chapter 1: Azure Virtual Networks, Addressing & Subnet Architecture
1.1 VNet Planning, IP Addressing & Subnet Design 1.2 Virtual Network Peering & Global Peering 1.3 Azure NAT Gateway & Outbound Connectivity 1.4 Azure Virtual Network Manager (AVNM) & Network Groups 1.5 Public IP Addresses, Public IP Prefixes & Custom IP Prefixes (BYOIP)
3 Chapter 2: Azure Name Resolution & Core Routing
2.1 Azure DNS & Private DNS Zones 2.2 Azure Private DNS Resolver & Hybrid Name Resolution 2.3 System Routes & User-Defined Routes (UDR) 2.4 BGP & Custom Route Propagation 2.5 Azure Route Server & Dynamic NVA Route Exchange
4 Chapter 3: Hybrid Connectivity with Azure VPN Gateway
3.1 Azure VPN Gateway Architecture & SKUs 3.2 Site-to-Site (S2S) VPN & High Availability 3.3 Point-to-Site (P2S) VPN & Client Authentication 3.4 Azure Extended Network, Always On VPN & Azure Network Adapter
5 Chapter 4: Azure ExpressRoute & Virtual WAN
4.1 Azure ExpressRoute Architecture & Peering Models 4.2 ExpressRoute Routing, Resiliency & Global Reach 4.3 Azure Virtual WAN Architecture & Hub Routing 4.4 ExpressRoute BFD, Monitoring & Connection Troubleshooting
6 Chapter 5: Regional Load Balancing & Application Gateway
5.1 Azure Load Balancer Architecture & Rules 5.2 Azure Application Gateway Architecture & Routing 5.3 Web Application Firewall (WAF) on Application Gateway 5.4 Inbound NAT Rules, Port Forwarding & Health Probe Design
7 Chapter 6: Global Traffic Management & Azure Front Door
6.1 Azure Front Door Architecture & Routing 6.2 Azure Traffic Manager & DNS Load Balancing 6.3 Load Balancing Decision Matrix & Multi-Tier Design 6.4 Web Application Firewall on Azure Front Door
8 Chapter 7: Azure Private Link & Service Endpoints
7.1 Virtual Network Service Endpoints & Policies 7.2 Azure Private Endpoints & Private Link Architecture 7.3 Private Endpoint DNS Integration & Hybrid Resolution 7.4 Azure Private Link Service for Multi-Tenant Solutions
9 Chapter 8: Network Security Groups & Azure Bastion
8.1 Network Security Groups (NSGs) & Application Security Groups (ASGs) 8.2 Azure Bastion Architecture & Secure Remote Access 8.3 Azure Virtual Network Manager Security Admin Rules
10 Chapter 9: Azure Firewall & Security Policies
9.1 Azure Firewall Architecture & Rule Processing 9.2 Azure Firewall Manager & DDoS Protection
11 Chapter 10: Azure Network Observability & Troubleshooting
10.1 Network Watcher Diagnostic Tools 10.2 NSG Flow Logs, VNet Flow Logs & Traffic Analytics 10.3 Network Troubleshooting Scenarios & End-to-End Connectivity 10.4 Azure Monitor Network Insights & Defender for Cloud Network Posture
10.2 NSG Flow Logs, VNet Flow Logs & Traffic Analytics
Key Takeaways Explain This Topic AI
NSG Flow Logs Version 1 records standard 5-tuple flow records and Allow/Deny decisions; Version 2 enhances records with packet throughput, byte throughput, and TCP flow state (Begin, Continuing, End).
VNet Flow Logs (Azure Network Watcher flow logs) operate directly at the Virtual Network or Subnet scope, capturing traffic from un-NSG'd subnets, Private Endpoints, GatewaySubnet, and AzureFirewallSubnet.
Flow logs are formatted in JSON and written to an Azure Storage account as block blobs partitioned by hourly folders: 'resourceId=.../y=YYYY/m=MM/d=DD/h=HH/m=00/macAddress=.../PT1H.json'.
Traffic Analytics enriches raw flow logs with Microsoft Threat Intelligence, topology metadata, and geographic mapping, processing data at configurable intervals of 10 minutes or 60 minutes.
KQL queries over the 'AzureNetworkAnalytics_CL' and 'NTANetAnalytics' tables allow network engineers to identify malicious IP communications, top bandwidth talkers, and inactive NSG rules.
Last updated: August 2026
NSG Flow Logs, VNet Flow Logs & Traffic Analytics
Deep visibility into packet flows across cloud virtual networks is critical for security compliance, threat detection, network capacity management, and auditing. In Azure, flow logging provides the raw telemetry required to reconstruct conversations traversing Network Security Groups and virtual network subnets.
Combined with Traffic Analytics , raw JSON flow records are enriched with Azure topology context, geographical geolocation data, and the Microsoft Threat Intelligence database to deliver comprehensive visibility into network communications.
1. NSG Flow Logs: Version 1 vs. Version 2
NSG Flow Logs capture IP traffic flowing through Network Security Groups associated with subnets and NICs. Flow logs are written to an Azure Storage account in JSON format. +-----------------------------------------------------------------------------+
- | NSG FLOW LOG FORMAT COMPARISON |
- | |
- | VERSION 1 FLOW RECORD STRUCTURE: |
- | "1590000000,10.1.0.4,198.51.100.2,443,51234,T,I,A" |
- | - Timestamp: 1590000000 |
- | - Source IP: 10.1.0.4 |
- | - Destination IP: 198.51.100.2 |
- | - Source Port: 443 |
- | - Destination Port: 51234 |
- | - Protocol: T (TCP) / U (UDP) |
- | - Direction: I (Inbound) / O (Outbound) |
- | - Decision: A (Allow) / D (Deny) |
- | |
- | VERSION 2 FLOW RECORD STRUCTURE (ADDS THROUGHPUT & STATE): |
- | "1590000000,10.1.0.4,198.51.100.2,443,51234,T,I,A,B,12,6144,8,4096" |
- | - Flow State: B (Begin) / C (Continuing) / E (End) |
- | - Packets Sent (Src -> Dst): 12 |
- | - Bytes Sent (Src -> Dst): 6144 |
- | - Packets Received (Dst -> Src): 8 |
- | - Bytes Received (Dst -> Src): 4096 |
- +-----------------------------------------------------------------------------+
- Key Architectural Differences
Dimension NSG Flow Logs Version 1 NSG Flow Logs Version 2
Core Information 5-Tuple (IPs, Ports, Protocol) + Direction + Allow/Deny 5-Tuple + Direction + Allow/Deny + Metrics + State
- Flow State Tracking None B (Begin), C (Continuing), E (End)
- Bandwidth Metrics Not Available Bytes Sent & Bytes Received
- Packet Metrics Not Available Packets Sent & Packets Received
Traffic Analytics Compatibility Compatible (limited throughput analysis) Fully Optimized (enables throughput & byte analytics)
Use Case Basic compliance and rule hit logging Capacity planning, volumetric DDoS detection, bandwidth cost tracking
2. VNet Flow Logs: Evolution Beyond NSGs
Historically, flow logging in Azure was tied strictly to Network Security Groups. However, modern enterprise topologies frequently include specialized subnets where NSGs cannot be associated or are restricted—such as AzureFirewallSubnet , GatewaySubnet , AzureBastionSubnet , or subnets hosting Private Endpoints .
VNet Flow Logs (configured as Azure Network Watcher Flow Log resources) elevate flow logging to the Virtual Network or Subnet scope :
Broader Coverage: Logs traffic traversing virtual networks and subnets regardless of whether an NSG is attached.
Private Endpoint Visibility: Captures traffic flows targeting Azure Private Link Private Endpoints residing within subnets.
Simplified Governance: Enables organizations to configure a single flow log resource at the VNet level that automatically captures all subnets within the address space, eliminating the operational overhead of managing dozens of individual NSG flow log associations.
Loading diagram... Flow Logs to Traffic Analytics Processing Pipeline
3. Storage Account Integration & Blob Partitioning
Flow logs are written to an Azure Storage account in block blobs using a deterministic, highly partitioned path hierarchy: resourceId=/SUBSCRIPTIONS/{subscriptionId}/RESOURCEGROUPS/{resourceGroupName}/
- PROVIDERS/MICROSOFT.NETWORK/{resourceType}/{resourceName}/
- y={YYYY}/m={MM}/d={DD}/h={HH}/m={00}/macAddress={MAC}/PT1H.json
- Storage Architecture Details
Hourly Partitioning ( PT1H.json ): Logs are aggregated and written in one-hour chunks per network interface MAC address. Each file contains JSON-formatted records representing all flows processed during that hour.
Storage Sizing & Retention Policies: Administrators can configure automatic retention policies ranging from 1 to 365 days , or set retention to 0 (indefinite retention). Standard General Purpose v2 (GPv2) storage accounts are recommended.
Read-Only Ingestion: Storage accounts holding flow logs can be ingested by third-party Security Information and Event Management (SIEM) systems (such as Splunk or Datadog) via Event Hub or Storage Blob triggers.
4. Traffic Analytics Architecture & Capabilities
Traffic Analytics is an Azure-native analytics solution that provides rich visibility into user and application activity across cloud networks. It processes raw flow logs from the storage account, cross-references them with Azure network topology and Microsoft Threat Intelligence, and writes structured records into an Azure Log Analytics workspace .
Processing Intervals: 10 Minutes vs. 60 Minutes
When enabling Traffic Analytics, administrators choose a data aggregation processing interval:
60-Minute Processing Interval (Default): Raw flow logs are processed every hour. Recommended for general capacity planning, trend reporting, and monthly auditing.
10-Minute Processing Interval: Raw flow logs are processed every 10 minutes. Recommended for security operations (SecOps) teams, rapid incident response, and active network troubleshooting where near-real-time visibility is required.
Core Analytical Capabilities
Threat Intelligence & Malicious Traffic Identification:
Identifies inbound and outbound communication with known malicious IP addresses, command-and-control (C2) servers, botnets, crypto-miners, and TOR exit nodes.
Visualizes malicious IP origins on interactive global geographic maps.
NSG Rule Optimization & Inactive Rule Pruning:
Identifies "zero hit" NSG rules (rules that have processed zero traffic over the evaluation period) that can be safely deprecated to simplify firewall policies.
Flags overly permissive security rules (e.g., rules allowing inbound traffic from 0.0.0.0/0 to sensitive administrative ports like 22 or 3389 ).
Top Talkers & Bandwidth Management:
Ranks top communicating host pairs, top talker virtual machines, and highest-bandwidth network protocols.
Tracks inter-region and inter-zone egress data transfer to optimize data transfer billing and architecture.
5. KQL Queries for Network Traffic Analysis
Traffic Analytics writes structured telemetry into custom tables inside the Log Analytics workspace, primarily AzureNetworkAnalytics_CL (and AzureNetworkAnalyticsIP_CL ). Network engineers can execute powerful Kusto Query Language (KQL) queries for diagnostic auditing.
Example 1: Identifying Blocked Malicious Inbound Traffic // Find all inbound flows from known malicious public IPs that were blocked by NSG rules
- AzureNetworkAnalytics_CL
- | where FlowType_s == "MaliciousFlow"
- | where FlowDirection_s == "I"
- | where FlowStatus_s == "D" // Denied by NSG
- | project TimeGenerated, SrcIP_s, DestIP_s, DestPort_d, L7Protocol_s, NSGList_s, Country_s
- | order by TimeGenerated desc
- | take 50
Example 2: Top 10 Internal Talkers by Byte Volume (Capacity Planning) // Identify internal VMs generating the highest outbound byte volume
- AzureNetworkAnalytics_CL
- | where FlowType_s == "IntraVNet" or FlowType_s == "InterVNet"
- | summarize TotalBytesSent = sum(OutboundBytes_d), TotalBytesReceived = sum(InboundBytes_d)
- by SrcIP_s, VM_s
- | extend TotalTrafficBytes = TotalBytesSent + TotalBytesReceived
- | top 10 by TotalTrafficBytes desc
- | project VM_s, SrcIP_s, TotalBytesSent, TotalBytesReceived, TotalTrafficBytes
Example 3: Auditing Cross-Region Egress Data Transfer // Detect cross-region egress flows to optimize data transfer costs
- AzureNetworkAnalytics_CL
- | where FlowType_s == "InterRegion"
- | summarize EgressGigabytes = sum(OutboundBytes_d) / (1024 * 1024 * 1024)
- by SourceRegion_s, DestRegion_s, VM_s
- | order by EgressGigabytes desc