Homeβ€Ί Blogβ€Ί Azure Architecture Series #103 β€” VNet Flow Logs and Traffic Analytics…
Azure Architecture Azure Architecture Series

Azure Architecture Series #103 β€” VNet Flow Logs and Traffic Analytics

Verified against current vendor documentation on 24 November 2026. Pricing, limits and API behaviour were checked against the official docs on that date. Cloud services change fast — if you are reading this much later, treat the specifics as a starting point and re-check the linked sources.

Business Challenge

#102 covered the reactive tools: a connection is broken, and you need to know why. This post is the other question, the one that arrives from an auditor, a finance team or a migration plan rather than from an incident. What is actually talking to what?

Nobody can answer that from configuration. A network security group lists what is permitted; the set of flows that actually happen is a different and usually much smaller set, and the gap between them is where decommissioning plans, segmentation projects and compliance evidence all live. Flow logs are the only record of the second set.

There is also a deadline attached, which is the practical reason to read this now rather than next year.

NSG flow logs retire on 30 September 2027, and already cannot be created

“Network security group (NSG) flow logs retire on September 30, 2027. Because the feature is retiring, it no longer supports new NSG flow logs creation.” After that date Azure “no longer supports traffic analytics enabled for NSG flow logs, and deletes existing NSG flow log resources in your subscriptions.”

One mercy in the wording: “Azure doesn't delete existing NSG flow log records from Azure Storage, and they continue to follow their configured retention policies.” The history survives; the collector does not. So this is not an optional modernisation — the clock is running on anything still logging at the NSG.

Architecture

Diagram: VNet flow logs and traffic analytics across four bands. The first band is the raw record, which operates at Layer 4, lands in one-minute blobs and is written in JSON. A version 2 tuple carries time, source and destination address, source and destination port, protocol, direction, flow state, encryption state, then packets and bytes sent and packets and bytes received. Version 5 adds a Private Link Service link identifier, a source NAT address and a source NAT port, and is available in three regions only. Flow state is B for begin, C for continuing, E for end and D for deny; direction is I for inbound or O for outbound. The band warns that counts on continuing and end records are aggregates since the previous tuple, so they must be added rather than read as a running total, and gives the documented example where one thousand and twenty-one plus fifty-two plus eight thousand and five plus forty-seven makes nine thousand one hundred and twenty-five packets, and five million two hundred and fifty-six thousand bytes, across a single conversation. The second band lists the eight encryption statuses and marks which mean the packet was dropped. X means encrypted as configured. NX means unencrypted and is the default for every virtual network. NX_LOCAL_DST means the two machines share an Azure host and the traffic is unencrypted by design rather than by fault. NX_FALLBACK means the flow was allowed but unencrypted after encryption was attempted and failed. Three statuses mean the packet was dropped: NX_SW_NOT_READY when the host stack is not ready after a boot or update, NX_NOT_ACCEPTED when a drop-on-unencrypted policy is in force and encryption failed, and NX_NOT_SUPPORTED when the host stack cannot perform discovery. NX_HW_NOT_SUPPORTED indicates a missing or faulty field-programmable gate array on the host. The third band covers the second aggregation that traffic analytics performs. It collapses records on source address, destination address, destination port, network security group name, network security group rule, direction and protocol, and it deliberately excludes the source port, which means connection counts cannot be recovered from a Log Analytics row. The processing interval is sixty minutes by default or ten minutes if selected, and ingestion can add up to another hour. The destination table is NTANetAnalytics at schema version three, replacing the older AzureNetworkAnalytics_CL. The band explains that a hundred conversations in an hour become a single row, that the portal reports the total it saw while Log Analytics shows the reduced record, that both are correct, and that the blob identifier is the way back to the individual flows in storage. The fourth band lists where the record simply does not exist. Egress from a virtual machine to an ExpressRoute circuit is not logged at the gateway subnet, and FastPath bypasses the gateway entirely. Twelve platform services are unsupported, among them Functions, Logic Apps, App Service, Container Instances and Container Apps. The storage account must be in the same region and on the Standard tier, and rotating its customer-managed key stops logging until the flow log is disabled and re-enabled. Pricing gives five gigabytes per month free per subscription for the logs themselves while traffic analytics has no free tier. And the band closes on the deadline: network security group flow logs retire on the thirtieth of September 2027, new ones already cannot be created, and the resources will be deleted.
Two aggregations between the packet and the dashboard, and the counts do not match on purpose.

Why the scope moved from the NSG to the virtual network

The old model logged at a network security group, which meant logging twice: NSG flow logs require configuration “at both the subnet and the network interface” to get complete coverage. Virtual network flow logs are enabled once, on the virtual network, and “traffic through all supported workloads within a virtual network is recorded.”

That is a simplification, but the capability gap is the bigger story. Several things only the newer logs can see:

ScopeNSG flow logsVNet flow logs
Bytes and packets in stateless flowsNot supportedSupported
Identification of virtual network encryptionNot supportedSupported
Azure API ManagementNot supportedSupported
Azure Application GatewayNot supportedSupported
Azure Virtual Network Manager rulesNot supportedSupported
ExpressRoute gatewayNot supportedSupported
VPN gatewayNot supportedSupported
ExpressRoute FastPathNot supportedNot supported

Gateways are the entry that changes a bill. Because the logs operate at the virtual network level they “capture traffic for resources such as gateways by default”, and the documentation is candid that this “can lead to a higher volume of log data.” Enabling this on a hub virtual network records everything crossing the hub.

Do not leave both enabled

“We recommend disabling network security group flow logs before enabling virtual network flow logs on the same underlying workloads to avoid duplicate traffic recording and additional costs.” And if you do both: “you might get duplicate logging or only virtual network flow logs” — an outcome that is not even deterministic. Turn the old one off first.

Why This Architecture Holds Up

Because the byte counts are deltas, not totals

This is the single most common way flow log analysis goes wrong. A conversation produces several tuples — one at Begin, some at Continuing, one at End — and “for continuation (C) and end (E) flow states, byte and packet counts are aggregate counts from the time of the previous flow's tuple record.”

They are deltas. You sum them. Microsoft's own worked example makes the point better than any warning: a single TCP conversation yields packet counts of 1,021, 52, 8,005 and 47, “the total number of packets transferred is 1,021 + 52 + 8,005 + 47 = 9,125”, and the bytes come to 5,256,000. Take the largest tuple instead of summing and you under-report by more than half.

Because “unencrypted” and “dropped” share a prefix

The encryption field has eight values, and they are not a simple encrypted/not-encrypted pair. Three of them mean the packet was discarded, which makes them availability signals rather than compliance signals:

StatusMeaningPacket
XEncrypted, as configuredDelivered
NXUnencrypted — the default for every virtual networkDelivered
NX_LOCAL_DSTSource and destination on the same Azure host — “isn't encrypted by design”Delivered
NX_FALLBACKAllow-unencrypted policy; encryption was attempted and failedDelivered
NX_SW_NOT_READYHost stack not ready — VM starting, restarting, or host being updatedDropped
NX_NOT_ACCEPTEDDrop-on-unencrypted policy both ends; encryption failedDropped
NX_NOT_SUPPORTEDHost networking stack can't do discovery — report to MicrosoftDropped
NX_HW_NOT_SUPPORTEDFPGA not attached or faulty — report to Microsoft—

NX_SW_NOT_READY is the one worth an alert. It fires on VM boot, on redeploy, and “when there's an update to the networking components on the host” — events you do not control — and during it the packet is dropped. The documentation says “the problem should be temporary”, which is true and is also a description of an intermittent connectivity fault that will be reported to you as an application bug.

One more: a flow denied because of encryption carries an aclID and rule name of unspecified. If your query joins flows to NSG rules, those records fall out of the join and the drop becomes invisible.

Because traffic analytics aggregates again, and drops the source port

Traffic analytics “reduces the log volume by aggregating flows that have a common source IP address, destination IP address, destination port, and protocol.” The documented example: two hosts communicating 100 times in an hour produce 100 raw entries and one reduced entry saying they communicated 100 times over HTTP on port 80.

The precise key is source IP, destination IP, destination port, NSG name, NSG rule, flow direction and transport protocol — and the schema page states the exclusion explicitly: “source port is excluded for aggregation.” That is the right call for volume and it costs you a specific capability: you cannot count distinct connections from a Log Analytics row, because every ephemeral source port collapsed into it.

The portal and Log Analytics will disagree. Both are correct.

“For any resource in traffic analytics, the flows indicated in the Azure portal are total flows seen, but in Azure Monitor logs, user sees only the single, reduced record. To see all the flows, use the blob_id field, which can be referenced from storage.”

So when someone's KQL row count doesn't match the dashboard, nothing is broken. The dashboard counts flows; the table counts reduced records. blob_id is the documented path back to the raw truth, and the one to reach for when an auditor wants individual connections rather than conversation summaries.

Latency compounds across the two stages. Blobs land at one-minute intervals; traffic analytics picks them up every 60 minutes by default, or every 10 minutes if you select the shorter interval — six times more often; and then “this process can take up to 1 hour” to reach Azure Monitor logs. Flow logs are an inventory, not a monitor. For anything that needs to page someone, use the tools from #102.

Two schema details that save a rewrite. The table is NTANetAnalytics at FASchemaVersion 3, and it “replaces AzureNetworkAnalytics_CL used in network security group flow logs” — so every saved query, workbook and alert built on the old table has to be rewritten as part of the migration, not after it. And the suffixes mislead: “some field names are appended with _s or _d, which don't signify source and destination but indicate the data types string and decimal.”

Because the enrichment is the actual product

Raw flows are IP addresses. What makes traffic analytics worth its processing fee is that it resolves them into topology: subscription, region, NIC, VM, subnet, load balancer, application gateway, ExpressRoute circuit and peering type, local network gateway, connection name, and the hub virtual networks in a hub-and-spoke path. Then it classifies every flow into one of nine types — IntraVNet, InterVNet, S2S, P2S, AzurePublic, ExternalPublic, MaliciousFlow, Unknown Private, Unknown.

Those last two are the useful ones for an audit. Unknown means traffic analytics “was unable to map either of the IP addresses in the flow with the customer topology in Azure and on-premises” — traffic whose endpoints nobody can name. MaliciousFlow means the far end appeared in the threat feeds for that interval, and those records carry a DNS domain, URL, port and one of eleven ThreatType values including C2, CryptoMining, Botnet and Phishing.

Enrichment has a visibility boundary

“A subscription is visible to traffic analytics in a Log Analytics workspace if it contains a flow log configured to that workspace.”

So a flow to a VM in a subscription that is not sending logs to the same workspace cannot be resolved, and gets classified as ExternalPublic or Unknown rather than InterVNet. In a large estate that misclassifies internal traffic as external, which is exactly backwards for a segmentation review. Centralise the workspace before you trust the flow-type distribution.

Because there are places the record does not exist at all

A log with gaps you do not know about is worse than no log, so these are worth reading as a list of questions your evidence cannot answer:

  • ExpressRoute egress. “Outbound flows from virtual machines (VMs) to ExpressRoute circuit aren't recorded if flow logging is enabled on the ExpressRoute gateway subnet” — they must be captured at the VM's subnet or NIC instead. And FastPath, from #76, bypasses the gateway, so that traffic is not recorded there either.
  • Twelve platform services. Container Instances, Container Apps, Logic Apps, Functions, DNS Private Resolver, App Service, Database for MariaDB, MySQL and PostgreSQL, SQL Managed Instance, NetApp Files and Power Platform. An App Service plan deployment is explicitly excluded.
  • API Management, conditionally. Traffic analytics “currently supports only Azure API Management instances deployed using VNet Injection”; VNet Integration deployments are not supported.
  • Private endpoint NICs. Version 5's Private Link context “applies only to Private Link Service (PLS) traffic captured at the backend” — capture at the private endpoint NIC is not supported. See #91.

And the storage account has its own set of ways to stop logging quietly: it must be in the same region, it must be Standard because premium is unsupported, and “if you change or rotate the customer-managed encryption keys to your storage account, virtual network flow logs stop working” — the fix being to disable and re-enable the flow log. A key rotation policy and a flow log are therefore on a collision course unless somebody wrote it down. There is also a sharp operational rule: logs are appended to a block blob, and editing, overwriting or deleting that blob mid-hour “can cause all subsequent flow log write operations to fail for that specific hour's blob.”

Because the migration has a one-way door

The migration tooling splits by shape of estate: use Azure Policy when every NIC and subnet in a virtual network shares the same NSG and the same flow log configuration, and the migration script when they do not, or when you deliberately want to preserve differing configurations.

The script asks one question that decides your resource count: migration with aggregation produces a single flow log on the virtual network, so an NSG attached to three NICs in one virtual network becomes one resource; without aggregation produces three, one per NIC. Fewer resources is usually right, and more resources preserves per-NIC configuration differences.

Two warnings in the documentation deserve to be read as written. “Once you start running the script, you shouldn't make any changes to the topology in the regions and subscriptions of the flow logs that you're migrating” — so this is a change-freeze activity. And on the confirmation prompt: “Once you accept the changes, you can't revert them.” Keep the analysis report; it is the only record of what the script decided.

Key Architecture Decisions

DecisionDo thisBecause
Still on NSG flow logsMigrate on a plan, not on the deadlineRetire 30 September 2027; new ones already blocked; resources deleted after.
Enabling VNet flow logsDisable the NSG flow logs firstOtherwise duplicate recording, double cost, and a non-deterministic outcome.
Where to enableVirtual network levelOne resource instead of subnet plus NIC; gateways included automatically.
Hub virtual networkBudget for it before enablingGateway traffic is captured by default, and that is the highest-volume traffic you have.
Computing bandwidth from tuplesSum the C and E recordsCounts are deltas since the previous tuple, not running totals.
Counting connectionsGo to the blob, not the tableTraffic analytics excludes source port from its aggregation key.
Alerting on connectivityDon't use flow logs60-minute default interval plus up to an hour of ingestion.
Need faster insight10-minute processing intervalSix times more frequent; ingestion latency still applies.
Multi-subscription estateOne central workspaceUnlogged subscriptions can't be resolved, so internal traffic reads as external.
Existing KQL, workbooks, alertsRewrite as part of the migrationNTANetAnalytics replaces AzureNetworkAnalytics_CL; schema version 3.
Customer-managed keys on the log storage accountDocument the dependencyA key rotation stops logging until the flow log is disabled and re-enabled.
Building a parserBranch on flowLogVersionVersion 5 appends three fields; don't infer positions from the sample.
Evidence for a segmentation reviewQuery Unknown and MaliciousFlow firstUnnameable endpoints and threat-feed hits are the findings; the rest is inventory.

Closing Thought

The thing I would want a new engineer to understand about flow logs is that there are two lossy steps between a packet and a dashboard, and each one was a deliberate trade. The first turns packets into one-minute tuples with delta counters, which is why you have to add them up. The second turns tuples into one row per conversation shape, which is why the source port is gone and why the portal's number is bigger than your query's.

Neither step is a bug, and neither is documented anywhere a person will look before they write their first query. The cost of not knowing is a number in a compliance report that is wrong by a factor nobody can explain — and flow logs are precisely the artefact people reach for when they need to be believed.

The one line to take away

Flow logs are an inventory, not a monitor: at a 60-minute default interval plus up to an hour of ingestion, they will tell you what talked to what yesterday with real authority, and they will never tell you what is broken right now.

Next in the series: network segmentation patterns for regulated workloads — where this inventory stops being interesting and starts being the evidence.

Official Azure Reference

Comments

How was your experience?
Your feedback helps improve this site.
PoorExcellent