Q: An Azure function is being throttled. How will you detect and fix it?
Root cause detection and architectural remediation runbook for resolving concurrency throttling and cold-start failures on Azure Functions under production load.
Want to master this scenario in a live sandbox? Stephane Maarek's AWS Certified DevOps Engineer Professional Masterclass on Udemy covers this exact problem with hands-on terminal drills.
🛠️ Production Runbook & Step-by-Step Resolution
Detect Throttling Signatures in Application Insights
Query Azure Application Insights and Azure Monitor for HTTP 429 (Too Many Requests), HTTP 503 (Service Unavailable), or event queue lag. Inspect the `FunctionExecutionCount` and `ThrottledCount` metrics.
# Kusto (KQL) Query to identify Function Throttling
requests
| where resultCode in ("429", "503")
| summarize count() by bin(timestamp, 5m), resultCode, operation_Name
| order by timestamp desc
Identify Scale Controller Bottlenecks & Consumption Limits
On the standard Consumption Plan, Azure Functions scale up to a maximum of 200 instances, but the Scale Controller adds new instances incrementally (e.g. 1 instance every few seconds). A sudden spike of 20,000 requests immediately overwhelms instances before scaling completes.
Migrate to Elastic Premium Plan or Set Pre-Warmed Instances
Upgrade critical production functions to the **Azure Functions Elastic Premium Plan**. Elastic Premium provides pre-warmed instances to eliminate cold starts, unlimited compute scale, and VNet integration.
# Update Azure Function App to Premium plan with minimum pre-warmed instances
az functionapp plan update \
--name plan-banking-premium \
--resource-group rg-banking \
--min-instances 5 \
--max-instances 50
Throttle Concurrency & Decouple via Message Buffers
If downstream databases are choking, throttle the function's maximum concurrency in `host.json` (`maxConcurrentRequests`) and buffer incoming requests through Azure Service Bus queues or Event Hubs to flatten traffic bursts.
- Query Application Insights with KQL to track HTTP 429/503 codes and scale controller delays.
- Upgrade from Consumption Plan to Elastic Premium to eliminate cold starts and scale bottlenecks.
- Configure pre-warmed instances to instantly absorb burst traffic.
- Buffer bursty traffic using Azure Service Bus queues to protect downstream databases from connection exhaustion.