AZ-204Chapter 35 of 102Objective 1.1

Azure Functions Premium Plan vs Consumption

This chapter covers the critical differences between Azure Functions Consumption and Premium plans, a core topic for the AZ-204 exam. Understanding when to choose each plan directly impacts cost, performance, and scalability of serverless applications. Approximately 10-15% of exam questions touch on Azure Functions hosting plans, with emphasis on plan selection criteria, scaling behavior, and networking capabilities.

25 min read
Intermediate
Updated May 31, 2026

Cloud Function Plans as Car Engines

Think of Azure Functions like different car engines for your serverless code. The Consumption plan is like a scooter engine: it's cheap, starts instantly for short trips, but if you try to go uphill (heavy load) for too long, it overheats (times out at 5 minutes for HTTP triggers, 10 minutes overall). It also shuts off when parked (idle), so you face cold starts. The Premium plan is like a hybrid car engine: it can run on battery (warm instances) for instant response, has a larger gas tank (30-minute timeout for HTTP, unlimited for other triggers via app setting), and can tow a trailer (connect to VNet). It also keeps the engine warm (always-ready instances) so no cold starts. The Dedicated plan (App Service plan) is like a full-size truck: always running, predictable, but you pay for it even when parked. Just as you choose a vehicle based on trip length, load, and budget, you choose a Function plan based on timeout needs, scaling requirements, and cost tolerance. The Premium plan's 'engine warm-up' (pre-warmed instances) and ability to 'drive on any road' (VNet integration) are key differentiators for enterprise workloads.

How It Actually Works

What Are Azure Functions Hosting Plans?

Azure Functions offers three hosting plans: Consumption, Premium, and Dedicated (App Service). This chapter focuses on Consumption vs. Premium, as these are the serverless options. The Dedicated plan runs functions on reserved VMs (like a standard App Service) and is not serverless.

Consumption Plan

The Consumption plan is the default, truly serverless option. You are charged only for the time your code runs (per execution and per GB-second). Scaling is automatic – Azure adds function host instances based on the number of incoming events. The plan has a 5-minute timeout for all triggers except HTTP triggers, which have a 2.5-minute timeout by default (configurable up to 10 minutes for HTTP triggers via functionTimeout in host.json). The maximum execution duration for all functions is 10 minutes (configurable up to 10 minutes).

Key characteristics: - Scaling: Scale out from zero to many instances based on trigger events. For Azure Functions, scaling is controlled by the Scale Controller, which monitors trigger queue lengths, event hub partitions, etc. The maximum number of instances is 200 (default) but can be increased via support request. - Cold start: When a function app is idle for about 20 minutes, the instance is deallocated. The next request triggers a cold start – loading the function host and your code, which adds latency (typically 1-10 seconds). - No VNet integration: Functions in the Consumption plan cannot access resources inside a Virtual Network (VNet) unless you use the Regional VNet Integration feature (which is limited and doesn't allow access to on-premises resources via VPN or ExpressRoute). - No always-ready instances: All instances are spun up on demand. - Billing: Pay per execution ($0.20 per million executions) and per GB-second ($0.000016/GB-s). The first 1 million executions and 400,000 GB-s are free each month.

Premium Plan

The Premium plan (also called Elastic Premium) provides enhanced performance and features while maintaining serverless billing (pay per execution and per GB-second, but with a base cost for always-ready instances). It is designed for applications that need: - No cold starts: With always-ready instances (configurable from 1 to 20), you can keep a minimum number of instances warm. - Unlimited execution duration: The default timeout is 30 minutes for HTTP triggers, and you can set functionTimeout to unlimited (0:00:00) in host.json for non-HTTP triggers, allowing functions to run up to the maximum of the plan (10 minutes for Consumption, unlimited for Premium). - VNet integration: Premium plan functions can connect to a VNet via VNet Integration (regional or gateway-required) and can access resources inside the VNet and on-premises via VPN/ExpressRoute. - More powerful instances: Premium plan uses more CPU and memory (minimum 1.75 GB RAM vs. 1 GB for Consumption). - Predictable scaling: You can set a maximum number of instances (default 100, up to 1000 with support).

Key characteristics: - Always-ready instances: You specify a minimum number of instances (cost is incurred even when idle). This eliminates cold starts for the first requests. - Scaling: The Scale Controller still scales automatically, but it can scale more aggressively because the plan has reserved capacity. Premium instances also have pre-warmed workers that are kept ready to handle bursts. - Billing: In addition to execution and GB-second costs (same rates as Consumption), you pay a base cost per always-ready instance (e.g., ~$0.00015/sec per instance). This base cost is incurred even if the function is idle. - Dedicated instances: Each function app runs on its own set of instances (no sharing with other apps in the same plan unless you deploy multiple apps to the same plan).

Internal Mechanisms

Scale Controller: A background process that monitors trigger events and decides how many instances are needed. For both plans, the Scale Controller uses a threshold-based algorithm:

For Service Bus queues: number of messages in the queue / 16 (each instance can process 16 messages concurrently).

For Event Hubs: each partition is processed by one instance (scale up to number of partitions).

For Blob storage: one instance per 10 blobs per second.

The Scale Controller also considers instance health and load balancing. In Premium, the Scale Controller can scale faster because it has pre-warmed workers available.

Instance warm-up: When a Premium plan function app is created, the Scale Controller immediately provisions the configured number of always-ready instances. These instances load the function host and your code, so they are ready to serve requests instantly. In Consumption, instances are provisioned only when events arrive.

Timeout configuration: In both plans, the functionTimeout property in host.json controls the maximum duration for function executions. For Consumption, the maximum is 00:10:00 (10 minutes). For Premium, you can set it to 00:00:00 for unlimited (but the actual maximum is bounded by the runtime, which is essentially unlimited; however, the function must complete within the lifetime of the instance – instances are recycled periodically).

Configuration and Verification

To create a function app in the Premium plan using Azure CLI:

az functionapp create --resource-group myRG --consumption-plan-location westus --name myFuncApp --storage-account mystorage --functions-version 4 --plan-type Premium --sku EP1

To check the current plan type:

az functionapp list --query "[?name=='myFuncApp'].{plan:appServicePlanId}" --output tsv

To set the always-ready instance count:

az functionapp update --resource-group myRG --name myFuncApp --set siteConfig.alwaysReadyInstances=2

To view the current timeout setting in host.json:

{
  "version": "2.0",
  "functionTimeout": "00:30:00"
}

Interaction with Related Technologies

Application Insights: Both plans support monitoring, but Premium plan can have more consistent telemetry due to no cold starts.

Azure Logic Apps: Can trigger functions; Premium plan is better for functions that need to complete quickly.

API Management: Functions behind APIM; Premium plan reduces latency from cold starts.

Durable Functions: The Consumption plan has a 10-minute timeout, which can be problematic for long-running orchestrations. Premium plan allows unlimited duration, making it the better choice for Durable Functions with long delays.

Walk-Through

1

Choose hosting plan

Evaluate your application requirements: execution duration, need for VNet integration, cold start sensitivity, and budget. If your functions run longer than 10 minutes, need to access VNet resources, or require consistent low latency, choose Premium. Otherwise, Consumption is cost-effective for sporadic workloads.

2

Configure always-ready instances

For Premium plan, set the number of always-ready instances in the Azure portal under 'Function App Settings' > 'Scale Out' > 'Always Ready Instances'. This ensures a minimum number of warm instances. The cost is incurred even when idle. Choose 1 for minimal cost or more for high availability.

3

Set maximum burst instances

In Premium plan, you can limit the maximum number of instances to control costs and avoid overwhelming downstream resources. Default is 100. Set via 'Scale Out' > 'Maximum Burst' in portal or via CLI.

4

Configure VNet integration

If your function needs to access resources in a VNet (e.g., SQL Database with private endpoint), enable VNet Integration in the Networking blade. Choose Regional VNet Integration (requires Premium plan) to route outbound traffic through the VNet. This allows access to VNet resources and on-premises via VPN/ExpressRoute.

5

Set function timeout

Edit host.json to set functionTimeout. For Consumption, max is 00:10:00. For Premium, set to 00:00:00 for unlimited. Note: HTTP functions have a separate timeout of 2.5 minutes default (configurable up to 10 min for Consumption, 30 min for Premium). Exceeding these limits results in function termination.

What This Looks Like on the Job

Enterprise Scenario 1: ETL Pipeline with VNet Access

A financial company needs to process sensitive data from an on-premises SQL Server. They use Azure Functions to trigger ETL jobs when new blobs appear in a storage account. The function must access the SQL Server via a VPN-connected VNet. The Consumption plan cannot meet this requirement because it lacks VNet integration. The Premium plan is chosen, with always-ready instances set to 2 to avoid cold starts during business hours. The function timeout is set to unlimited because some ETL jobs may run longer than 10 minutes. In production, they configure Regional VNet Integration and route all outbound traffic through the VNet. A common misconfiguration is using gateway-required VNet Integration, which is not supported for Premium; instead, Regional VNet Integration is used. They also set a maximum burst of 50 instances to control costs. When misconfigured (e.g., no VNet integration), the function fails to connect to SQL Server, causing timeouts and retries.

Enterprise Scenario 2: High-Throughput API with Consistent Latency

An e-commerce platform exposes an HTTP-triggered function behind Azure API Management to handle product search. The function must respond in under 100ms. In the Consumption plan, cold starts cause occasional delays of 2-5 seconds, which degrades user experience. They switch to Premium plan with 3 always-ready instances, ensuring sub-100ms response times. The function timeout is set to 30 seconds (default). They also enable Application Insights to monitor performance. Scaling is automatic based on request rate; they set maximum burst to 200 instances. A common mistake is setting always-ready instances too high, incurring unnecessary cost. They monitor the minimum required instances during peak hours and adjust accordingly.

Enterprise Scenario 3: Long-Running Durable Function Orchestration

A logistics company uses Durable Functions to orchestrate a multi-step process that includes human approval with a 24-hour timeout. The Consumption plan's 10-minute execution limit forces the orchestration to fail. They migrate to Premium plan with unlimited timeout. The function app is configured with 1 always-ready instance to keep the orchestrator warm. They also use VNet integration to access an on-premises database. In production, they set the maxConcurrentActivityFunctions to 10 to limit parallelism. A common pitfall is forgetting to set functionTimeout to unlimited, causing functions to time out after 30 minutes (Premium default).

How AZ-204 Actually Tests This

AZ-204 Exam Focus on Azure Functions Plans

The AZ-204 exam (objective 1.1: Create Azure Functions) tests your ability to select the appropriate hosting plan based on requirements. Key objective codes: 1.1.1 (implement Azure Functions), 1.1.2 (configure hosting plan).

Most common wrong answers and why: 1. Choosing Consumption for VNet integration: Many candidates think Consumption supports VNet integration because of 'Regional VNet Integration' but it only works with Premium and Dedicated plans. Consumption has limited outbound VNet integration (via private endpoints) but cannot access on-premises resources via VPN/ExpressRoute. 2. Believing Premium plan has no cold starts: While always-ready instances eliminate cold starts for the first request, if the function scales beyond the always-ready count, new instances may experience cold starts. The correct statement is 'Premium plan reduces cold starts but does not eliminate them entirely.' 3. Assuming unlimited timeout for all triggers: Premium plan allows unlimited timeout for non-HTTP triggers only. HTTP triggers have a default 30-minute timeout (configurable up to 30 minutes). The functionTimeout in host.json applies to all triggers, but HTTP has an additional request timeout. 4. Confusing 'always-ready' with 'maximum burst': Always-ready instances are kept warm; maximum burst is the upper limit of instances. Setting always-ready to 5 doesn't mean the app will only scale to 5; it can scale up to the maximum burst.

Specific numbers and terms that appear verbatim: - Consumption plan timeout: 10 minutes (configurable) - Premium plan default timeout: 30 minutes for HTTP - Always-ready instances: 1-20 (Premium) - Maximum instances: 200 for Consumption (default), 100 for Premium (default) - Billing: Consumption – $0.20/million executions, $0.000016/GB-s - Premium – same execution and GB-s rates + base cost per always-ready instance (~$0.00015/sec)

Edge cases: - A function app in Consumption plan can be scaled to 0 instances when idle; the first request triggers a cold start. For Premium, if you set always-ready to 0, it behaves like Consumption (but still has VNet integration). - The functionTimeout setting in host.json is per-function app, not per function. All functions in the app share the same timeout. - When using Premium plan with VNet integration, outbound traffic goes through the VNet; inbound traffic still goes through the public endpoint (unless you use private endpoints).

How to eliminate wrong answers: - If the question mentions 'VNet access', eliminate Consumption. - If the question mentions 'long-running function >10 minutes', eliminate Consumption. - If the question mentions 'cost sensitive with sporadic traffic', eliminate Premium (and Dedicated). - If the question mentions 'no cold start', look for 'always-ready instances' or 'Premium'.

Key Takeaways

Consumption plan timeout: 10 minutes max for all triggers; HTTP default 2.5 min, configurable to 10 min.

Premium plan timeout: 30 minutes default for HTTP; unlimited for other triggers via functionTimeout = 0.

Premium plan always-ready instances: 1-20, incurring cost even when idle.

Consumption plan max instances: 200 (default); Premium plan: 100 (default).

VNet integration is only available in Premium and Dedicated plans (not Consumption).

Cold starts occur in Consumption after ~20 minutes of idle; Premium eliminates them with always-ready instances.

Choose Consumption for short-lived, sporadic, non-VNet functions; Premium for long-running, VNet, or low-latency requirements.

Easy to Mix Up

These come up on the exam all the time. Here's how to tell them apart.

Consumption Plan

Maximum execution timeout: 10 minutes

No VNet integration (limited outbound via private endpoints)

Cold starts occur after ~20 minutes of idle time

Maximum 200 instances (default)

Billing: only pay per execution and GB-second

Premium Plan

Unlimited execution timeout (configurable)

Full VNet integration (Regional VNet)

Always-ready instances eliminate cold starts (configurable 1-20)

Maximum 100 instances (default, up to 1000 with support)

Billing: execution + GB-second + base cost per always-ready instance

Watch Out for These

Mistake

Consumption plan has no timeout limit.

Correct

Consumption plan has a maximum execution timeout of 10 minutes for all triggers (configurable). HTTP triggers have a default 2.5-minute timeout, configurable up to 10 minutes.

Mistake

Premium plan eliminates cold starts completely.

Correct

Premium plan reduces cold starts by keeping always-ready instances warm, but if the app scales beyond the always-ready count, new instances may experience cold starts.

Mistake

Consumption plan supports VNet integration for outbound traffic.

Correct

Consumption plan does not support Regional VNet Integration. It only supports limited outbound VNet access via private endpoints, but cannot access on-premises resources via VPN/ExpressRoute.

Mistake

Premium plan costs the same as Consumption plan.

Correct

Premium plan has additional base costs for always-ready instances and higher per-second rates for the compute resources. It is more expensive than Consumption for low-traffic scenarios.

Mistake

You can set functionTimeout to unlimited in Consumption plan.

Correct

In Consumption plan, the maximum functionTimeout is 00:10:00 (10 minutes). Unlimited is only supported in Premium plan.

Do You Actually Know This?

Reveal each answer, then mark whether you got it right. Score 60%+ to unlock the next chapter.

Frequently Asked Questions

What is the maximum execution time for an Azure Function in the Consumption plan?

The maximum execution time is 10 minutes for all triggers. HTTP triggers have a default timeout of 2.5 minutes, but you can increase it to up to 10 minutes via the `functionTimeout` setting in host.json. If your function runs longer, it will be terminated. For longer durations, use the Premium plan.

Does the Premium plan support VNet integration?

Yes, the Premium plan supports Regional VNet Integration, allowing your function to access resources inside a Virtual Network and on-premises via VPN or ExpressRoute. This is not available in the Consumption plan. You configure it in the Networking blade of the function app.

How do I eliminate cold starts in Azure Functions?

Use the Premium plan with always-ready instances. Set the number of always-ready instances to at least 1. This keeps a warm instance running, so the first request doesn't incur a cold start. Note that if the app scales beyond the always-ready count, new instances may still experience cold starts.

Can I use the Consumption plan with a Virtual Network?

The Consumption plan has limited VNet support. You can use private endpoints to access some Azure services privately, but you cannot integrate with a VNet for outbound traffic to on-premises resources. For full VNet integration, use the Premium or Dedicated plan.

What is the difference between always-ready instances and pre-warmed instances?

Always-ready instances are a Premium plan feature where you specify a minimum number of instances that are kept warm. Pre-warmed instances are a concept in the scale controller where additional instances are kept ready to handle bursts, but they are not configurable by the user. Always-ready instances are user-defined and incur cost.

How does billing differ between Consumption and Premium plans?

Both plans charge per execution and per GB-second at the same rates. However, Premium plan adds a base cost per always-ready instance (e.g., ~$0.00015 per second per instance). This base cost is incurred even when the function is idle. Consumption has no base cost, making it cheaper for low-traffic scenarios.

What is the default timeout for an HTTP trigger in the Premium plan?

The default timeout for an HTTP trigger in the Premium plan is 30 minutes. You can configure it up to 30 minutes via the `functionTimeout` setting in host.json. For non-HTTP triggers, you can set it to unlimited (0).

Terms Worth Knowing

Ready to put this to the test?

You've just covered Azure Functions Premium Plan vs Consumption — now see how well it sticks with free AZ-204 practice questions. Full explanations included, no account needed.

Done with this chapter?