# Azure Functions for event processing: Flex Consumption, Premium or Container Apps

> Start a queue or stream consumer on Flex Consumption: per-function scaling, private triggers with no extra setting, nothing to pay when the queue is empty. Worked East US prices show when always ready, Container Apps or Premium wins.

- Canonical: https://www.alpacamango.com/docs/azure-functions-flex-consumption-or-premium
- Author: Captain Spitt McGee
- Published: 2026-11-26 · Updated: 2026-11-22
- Topics: Azure, Event-driven, Serverless, Architecture

**For a queue or stream consumer, start on Flex Consumption: each trigger scales on its own instances, a queue behind a private endpoint needs no extra setting, and an empty queue costs nothing. Add an always-ready instance once the consumer is busy 40 per cent of the time; past that point it is a discount, not a cold-start fix. Move to Container Apps when the consumer runs flat out or already ships as a container, and keep Premium for what Flex cannot do.**

## What each plan bills for

Once [event-driven architecture on Azure](/docs/event-driven-architecture-on-azure) has picked the broker, a consumer's traffic decides which meter hurts.

- **Flex Consumption** bills an instance's memory (512 MB, 2,048 MB or 4,096 MB) only while it is executing, plus a charge per execution. Always-ready instances add a low baseline rate.
- **Premium** (EP1 to EP3) bills the cores and memory allocated, idle or not, keeps at least one instance running and has no charge per execution.
- **Container Apps** runs the function app as your own image, scaled by KEDA rules generated from its triggers, and on its Consumption plan bills vCPU and memory per replica-second. Only HTTP requests from outside the environment are billable, so a queue trigger adds none.

## Why Flex suits consumers

Flex scales per function: HTTP functions as one group, Durable Functions and Event Grid-based Blob triggers as two more, and every other trigger on instances of its own. Orders and clickstream consumers each follow their own backlog, and neither borrows the API's instances. Premium scales the whole app.

Private networking used to be the reason to pay for Premium, and on Premium it hides a trap: a Service Bus or Event Hubs trigger behind a private endpoint does not scale past the prewarmed instance count until runtime scale monitoring is on, so the consumer looks healthy until its first busy day. Flex needs no switch. On Premium, turn it on:

```bash
az resource update -g orders-rg -n orders-func/config/web --resource-type Microsoft.Web/sites \
  --set properties.functionsRuntimeScaleMonitoringEnabled=1
```

On Flex, set a maximum instance count (default 100) that the database behind the consumer can survive. The cap is per function group and leaves out always-ready instances, so ProcessOrder below can reach 41, and every group writing to that database gets its own 40. All Flex apps in a subscription and region share a default quota of 250 cores, so one runaway consumer can stall the rest. Event Hubs consumers never exceed one instance per partition.

```bash
az functionapp scale config set -g orders-rg -n orders-func --maximum-instance-count 40
az functionapp scale config always-ready set -g orders-rg -n orders-func --settings function:ProcessOrder=1
```

## The numbers for a consumer that never sleeps

Take a consumer that keeps one core busy for a 730-hour month, at East US pay-as-you-go list prices from Azure's Retail Prices API on 22 November 2026, before free grants (see the [Functions](https://azure.microsoft.com/en-us/pricing/details/functions/) and [Container Apps](https://azure.microsoft.com/en-us/pricing/details/container-apps/) pricing pages):

- **Flex on demand**, a 2,048 MB instance at $0.000026 per GB-second: $136.66.
- **Flex with one always-ready instance**, $0.000004 per GB-second of baseline plus $0.000016 while executing: $105.12.
- **Premium EP1** (one vCPU, 3.5 GB) at $0.173 per vCPU-hour and $0.0123 per GB-hour: $157.72.
- **Container Apps**, one vCPU and 2 GiB at the active rates of $0.000024 per vCPU-second and $0.000003 per GiB-second: $78.84.

Both Flex lines add $0.40 per million executions. The always-ready baseline runs every second, but each busy second costs $0.00001 per GB less than on demand, so the instance breaks even at 40 per cent busy. Premium's flat rate only beats always-ready Flex past about 130 million executions a month per busy core, some 50 a second handled singly. A batch trigger counts one execution per batch, so stream consumers rarely get close.

## When Premium or Container Apps is the answer

Premium earns its minimum bill when you need what Flex lacks: deployment slots, Windows, instances of up to four cores and 14 GB, or several function apps sharing paid instances (Flex allows one per plan). Moving to or from Flex means a new app.

Container Apps fits when the function is one container among several, sharing an environment, network and logs with its neighbours and carrying sidecars, Dapr, a GPU or any OS dependency. Flex runs images only in preview, without the Service Bus extension or Durable Functions. The price is ownership: you rebuild whenever Microsoft updates the Functions base images.

When Flex or Premium scales in, a running execution gets 60 minutes to finish; for longer messages, use a [Container Apps job](/docs/azure-container-apps-jobs-keda). On any plan a message cut short comes back, so the handler must survive a second delivery; [idempotent consumers on Service Bus](/docs/azure-service-bus-idempotent-consumers) covers where to keep the key.

## On AWS and Google Cloud

On AWS, Lambda reading SQS through an event source mapping is the Flex equivalent, with provisioned concurrency as always ready. Lambda Managed Instances takes Premium's place: functions on EC2 instances, billed at the EC2 price plus a 15 per cent management fee, scaling to a minimum you set rather than to zero. On Google Cloud, Cloud Run functions are Cloud Run services, so minimum instances do the always-ready job, and a worker pool is the container-first pull consumer.

## The diagram

One Flex Consumption app whose API and two consumers scale on separate instances, reading Service Bus and Event Hubs through private endpoints. [Open it in archhy](https://archhy.com/d/0Zx4xasdhXgJ?utm_source=alpacamango) and press Make a copy to adapt it.
