Hosting plans and scaling
The hosting plan decides how your function app scales, how long functions can run, whether it can reach private networks and how you pay. Picking the right one is one of the first design decisions.
- Flex ConsumptionServerless, fast scale, VNet, always-ready option.
- ConsumptionServerless, scale to zero, 10-minute max timeout.
- PremiumPre-warmed, no cold start, VNet, always billed.
- DedicatedApp Service VMs, manual or autoscale rules.
- Container AppsContainers with event-driven scale.
Most new apps start on Flex Consumption.
The plans
- Flex Consumption: the recommended serverless plan for new apps. Linux, scales out fast and per function, can scale to zero, supports virtual network integration, and lets you keep always-ready instances to avoid cold starts. Pay for execution plus any always-ready instances.
- Consumption: the original serverless plan. Scales to zero and bills per execution, but has slower cold starts, no VNet support and a 10-minute maximum function timeout (5 minutes by default).
- Premium (Elastic Premium): pre-warmed instances so there are no cold starts, VNet integration, longer runs and bigger instances. You pay for instances all the time.
- Dedicated (App Service plan): runs on App Service VMs you already pay for; no event-driven scale-to-zero, you scale by instance count or autoscale rules.
- Azure Container Apps: run the function app as a container next to other microservices, with event-driven scaling.
How scaling works
A scale controller watches the event sources (queue length, Service Bus backlog, HTTP traffic) and adds or removes instances. Each instance can run many invocations at once.
Cold start is the delay when a new instance starts and loads your app. It matters for HTTP APIs used by people; it rarely matters for background queues.
Limit concurrency per instance in host.json, and the maximum number of instances on the app, to protect a database that cannot keep up.
Setting maximum scale-out
On Flex Consumption you can cap instances when you create or update the app, which is a cheap way to protect downstream systems.
az functionapp create --resource-group rg-shop --name shop-func \
--storage-account shopfuncstore --flexconsumption-location westeurope \
--runtime dotnet-isolated --runtime-version 8.0
az functionapp scale config set --resource-group rg-shop --name shop-func \
--maximum-instance-count 20How to choose
- Start with Flex Consumption for most new apps.
- Choose Premium when you need warm instances all the time, Windows, or features Flex does not offer yet.
- Choose Dedicated when you already have spare App Service capacity, or need fully predictable cost.
- Choose Container Apps when your team already runs containers there.
Interview question
What is a cold start in Azure Functions and how do you reduce it?
A cold start is the extra delay when a new instance has to start and load the app before it can handle a request, which happens after scaling from zero or scaling out. I reduce it by using Flex Consumption always-ready instances or the Premium plan's pre-warmed instances, keeping the app small with few heavy start-up dependencies, and using ReadyToRun builds.
Want the full details? Read the official Microsoft documentation for this topic.