An Azure service that provides an event-driven serverless compute platform.
On the legacy Consumption plan, Azure Functions controls event-driven scale-out automatically, so configure only an optional instance cap; for .NET 8 isolated cold starts, enable isolated-worker placeholders and ReadyToRun, then move to Flex Consumption or Premium if consistently warm HTTP capacity is required.
Configure Consumption-plan scaling
The scale controller monitors incoming events and adds or removes host instances. On Consumption, the entire function app is the scaling unit: all functions in the app share resources and scale together. For HTTP triggers, new instances are allocated at most once per second.^1^
There is no CPU- or schedule-based autoscale rule to create for this plan. Concentrate on these controls:
- Leave the scale limit unrestricted unless a downstream system needs protection.
-
functionAppScaleLimitset to0ornullmeans unrestricted up to the plan maximum. - A value from
1upward imposes a lower app-level maximum.
-
- To impose a limit, for example 20 instances:
az resource update \
--resource-type Microsoft.Web/sites \
--resource-group <RESOURCE_GROUP> \
--name <FUNCTION_APP>/config/web \
--set properties.functionAppScaleLimit=20
A low cap can increase HTTP latency or cause rejection under load, so load-test at expected peak traffic before reducing it.^1^
- Check for accidental scale restrictions.
- Review
functionAppScaleLimit. - Check whether a Daily Usage Quota established during development is still present.
- Review trigger concurrency and singleton patterns, which can artificially restrict throughput.^2^
- Review
If HTTP and background functions have substantially different load profiles, separate function apps can provide independent scaling boundaries. Within one Consumption-plan app, all functions scale together.^2^
Reduce .NET 8 isolated cold-start time
Consumption apps can scale to zero after being idle. The next HTTP request must start an instance, host, worker process, and application; legacy Consumption has no always-ready setting, so cold starts remain expected.^1^
1. Enable .NET isolated placeholders
First ensure the project uses:
-
Microsoft.Azure.Functions.Worker1.19.0 or later. -
Azure.Functions.Sdk1.0.0 or later. - A
Microsoft.AspNetCore.Appframework reference.
For example:
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.Azure.Functions.Worker"
Version="1.21.0" />
</ItemGroup>
Then configure the app:
az functionapp config appsettings set \
--resource-group <RESOURCE_GROUP> \
--name <FUNCTION_APP> \
--settings WEBSITE_USE_PLACEHOLDER_DOTNETISOLATED=1
az functionapp config set \
--resource-group <RESOURCE_GROUP> \
--name <FUNCTION_APP> \
--net-framework-version 8 \
--use-32bit-worker-process false
The target-framework configuration must match the project, and placeholders require the remaining app configuration to be correct or the app might fail to start. The app-setting change restarts the function app.^3^^4^
2. Publish ReadyToRun binaries
ReadyToRun performs ahead-of-time compilation and can improve startup performance on Consumption. It is supported for .NET 8 isolated apps on Functions runtime 4.x.^3^
Add properties matching the Function App operating system and architecture:
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<PublishReadyToRun>true</PublishReadyToRun>
<!-- Use win-x64 for 64-bit Windows or linux-x64 for Linux. -->
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
</PropertyGroup>
Publish for that runtime:
dotnet publish -c Release -r win-x64 -p:PublishReadyToRun=true
A runtime-identifier/hosting-architecture mismatch can cause startup failure.
3. Identify what portion is actually slow
Compare a request after several idle minutes with an immediate second request:
- If only the first request is slow, investigate startup and cold start.
- If both are slow, inspect application initialization and dependency calls.
- Use Application Insights transaction diagnostics to correlate requests, exceptions, and outbound HTTP, database, file-system, or Azure SDK dependencies. Dependency telemetry records call duration and failure state.^5^
Keep startup work small: avoid eagerly initializing large dependency graphs or making network calls during process startup where those operations can be deferred safely.
When optimization is not enough
Legacy Consumption cannot maintain a warm minimum instance. For predictable low-latency HTTP responses, migrate to:
- Flex Consumption, which has improved scale-from-zero behavior and supports configurable always-ready instances.
- Premium, which supports prewarmed and always-ready instances, with at least one instance continuously available.^6^
This changes the solution from reducing cold-start duration to maintaining warm capacity, with the corresponding increase in baseline cost.
References