Networking
Azure Functions Flex Consumption: diagnose network scale-out before resizing the subnet
A production runbook for separating regional quota, concurrency, VNet Integration, subnet capacity, DNS, routing and backend limits before changing a Flex Consumption network path.
A Flex Consumption function app normally drains a queue within seconds. After VNet integration is enabled, a traffic burst makes the backlog grow, private dependencies become intermittent and scale-out appears to stall. The first diagnosis is that the integration subnet has run out of addresses, so the team prepares a larger subnet and an emergency network cutover.
That conclusion applies the App Service plan model, where each instance consumes an address, to a different architecture. Flex Consumption uses a platform-managed pool of network gateways and multiplexes function instances. A /27 can support one app scaling to 1,000 instances; /26 is recommended for multiple apps or high-scale workloads. On a shared subnet, gateway throughput can become the constraint rather than IP exhaustion. The same symptom can also come from regional memory quota, concurrency, a UDR, DNS or the downstream service.
The running case is a Service Bus-triggered Flex Consumption app that calls a private API and writes to Storage. This runbook must end with a concrete decision: retain the design, isolate the app on another subnet, repair the network path, request more quota or roll back VNet Integration.
Freeze the contract before the next burst
Evidence must connect incoming demand, scale decisions, executions and outbound calls. Preserve one UTC window with normal traffic and one with the burst, together with the deployed configuration.
application: fn-orders-prod
plan: FlexConsumption
region: westeurope
trigger: service-bus/orders
integration_subnet: vnet-app-prod/snet-functions-flex
subnet_prefix: /27
shared_apps:
- fn-orders-prod
maximum_instance_count: 100
instance_memory_mb: 2048
dependencies:
- api-orders.internal.example:443
- stordersprod.blob.core.windows.net:443
acceptance:
backlog_returns_to_baseline_minutes: 10
dependency_success_rate_percent: 99.5
dns_failures: 0
network_timeouts: 0
rollback:
owner: platform-on-call
restore_previous_integration: true Do not change concurrency, maximum instances, routes and subnet in the same experiment. One variable per canary is what makes the recovery explainable.
Inventory the plan, integration and subnet
Flex Consumption requires a dedicated subnet of at least /27, delegated to Microsoft.App/environments. It cannot also host private endpoints, service endpoints, another hosting delegation or a Container Apps environment. Multiple Flex apps can share it, but they also share the underlying networking resources.
RG="rg-app-prod"
APP="fn-orders-prod"
VNET_RG="rg-network-prod"
VNET="vnet-app-prod"
SUBNET="snet-functions-flex"
az functionapp show -g "$RG" -n "$APP" -o json > functionapp.json
az functionapp vnet-integration list -g "$RG" -n "$APP" -o json > vnet-integration.json
az network vnet subnet show -g "$VNET_RG" --vnet-name "$VNET" -n "$SUBNET" --query '{id:id,prefix:addressPrefix,prefixes:addressPrefixes,delegations:delegations[].serviceName,nsg:networkSecurityGroup.id,routeTable:routeTable.id,privateEndpoints:privateEndpoints[].id}' -o yaml
az provider show -n Microsoft.App --query registrationState -o tsv Correct delegation proves that the platform can use the subnet. It does not prove that the app is currently integrated, or that routes, DNS and outbound rules can reach the dependency. Check region as well: the app and VNet must be in the same region for this integration.
Separate application scaling from regional capacity
A rising backlog is not proof of a network failure. Flex Consumption scale depends on function groups, per-instance concurrency, the configured maximum and the regional memory quota shared by Flex apps in the subscription. Always-ready instances also consume that quota.
Preserve the scale configuration, trigger backlog, execution count, duration and dependency errors. In the portal, the Flex Consumption Quota tool under Diagnose and solve problems shows current quota and historical use. If several apps in the region stop scaling together without a rise in network errors, regional quota is a stronger hypothesis than subnet capacity.
Backlog rises, no new executions
Check trigger, host errors, maximum instance count and regional quota
Executions rise, dependencies remain stable
Check concurrency, code duration and backend capacity
Executions rise, network timeouts rise
Check DNS, NSG, UDR, firewall and shared-subnet throughput
One app is affected on a shared subnet
Compare destination, function group and application configuration
All apps on the subnet fail during the burst
Measure shared contention before isolating or enlarging the subnet Raising maximumInstanceCount while a backend is already throttling can accelerate the incident. Acceptance must cover the called service, not only how quickly the function app scales.
Read telemetry from the execution path
Application Insights shows what the code observed. Correlate executions, dependencies and exceptions over the same window, then separate resolution failures, TCP timeouts, HTTP responses and backend throttles.
let start = datetime(2026-10-10T05:00:00Z);
let stop = datetime(2026-10-10T05:30:00Z);
dependencies
| where timestamp between (start .. stop)
| where cloud_RoleName == "fn-orders-prod"
| summarize
calls = count(),
failures = countif(success == false),
p95_ms = percentile(duration, 95)
by bin(timestamp, 1m), target, resultCode
| order by timestamp asc let start = datetime(2026-10-10T05:00:00Z);
let stop = datetime(2026-10-10T05:30:00Z);
exceptions
| where timestamp between (start .. stop)
| where cloud_RoleName == "fn-orders-prod"
| where outerMessage has_any ("Name or service not known", "No such host", "timed out", "connection reset", "throttl")
| summarize occurrences=count() by bin(timestamp, 1m), type, outerMessage
| order by timestamp asc A timeout does not identify a firewall by itself. It can come from an overloaded backend, asymmetric routing or DNS waiting on multiple resolvers. Correlate dependency telemetry with available NSG or firewall logs and target-service telemetry. No deny record is not proof that the network is clear when logging is incomplete.
Test DNS, routes and controls from the actual path
The test must originate from an integrated Flex execution, not an administrator workstation. Temporarily deploy a protected diagnostic function or a canary message that resolves the FQDN, opens TLS and performs a side-effect-free read. Return timings and a correlation identifier, never a secret.
{
"correlationId": "net-canary-20261010-01",
"hostname": "api-orders.internal.example",
"resolvedAddresses": ["10.42.8.12"],
"dnsDurationMs": 8,
"tcpConnectMs": 14,
"tlsHandshakeMs": 31,
"httpStatus": 200,
"totalDurationMs": 61,
"functionGroup": "function:ProcessOrders"
} If the FQDN resolves to an unexpected address, fix DNS before changing NSGs. If resolution is correct but the connection expires, inspect the effective route, UDR, next hop, outbound rules and firewall. With all-traffic routing enabled, public destinations also traverse controls attached to the integration subnet, so a public dependency can fail at the same time as a private one.
Prove or reject shared-subnet contention
Do not estimate IP exhaustion by multiplying instances by addresses. Flex Consumption does not use that allocation model. Instead, inventory apps integrated with the subnet, their scale windows, outbound volume and destinations. Correlation across several apps and rising latency without explicit denies is a signal of possible contention, not yet proof.
The useful experiment moves one canary app to a compliant isolated subnet with equivalent NSGs, UDRs and DNS. Replay bounded load and compare throughput, p95, errors and backlog. If isolation changes the result while regional quota and the backend remain stable, a dedicated /26 or an explicitly capacity-managed shared subnet becomes a defensible decision.
An assigned integration subnet cannot be resized in place. Prepare the replacement through IaC, validate delegation and controls, then treat the integration change as a reversible migration. Keep the old path until the observation window closes.
Decide, validate or roll back
promote:
when:
- canary_reaches_private_dependencies
- backlog_returns_within_budget
- no_dns_or_network_timeout
- backend_has_capacity
- regional_quota_has_headroom
hold:
when:
- evidence_does_not_separate_quota_from_network
- shared_subnet_contention_not_reproduced
- downstream_throttling_remains
rollback:
when:
- dependency_success_rate_regresses
- route_or_dns_path_differs_from_contract
- canary_increases_backlog_or_error_rate
actions:
- restore_previous_vnet_integration
- restore_previous_scale_and_concurrency_values
- keep_new_subnet_for_evidence_until_review Validate under controlled load, from the affected function group, against a real dependency with a side-effect-free operation. Keep backlog, instances, dependencies, quota and network logs on one timeline.
Conclusion
On Flex Consumption, “the subnet is full” is often a diagnosis borrowed from the wrong model. The decision comes from an evidence chain: trigger demand, concurrency, scale limit, regional quota, execution telemetry, DNS, routing, controls and backend capacity. Enlarge or isolate the subnet only after reproducing shared contention. Otherwise, repair the layer that actually failed and keep an explicit network rollback.