liveBook · Manning

Azure Functions Consumption plan

As explained in Microsoft Azure in Action

An Azure Functions Consumption plan is a hosting option that automatically scales function execution and charges for the compute resources consumed.

An image arrives in Blob Storage and needs resizing, but the resizing code may sit idle for hours. An Azure Function App gives that code a home; the Consumption plan lets it run when triggered instead of keeping capacity running all day. Execution scales automatically, even down to zero, and charges reflect executions and resources consumed. section 2.2.16 section 8.2.3

Choose the plan with its trade-offs in mind:

  • Consumption suits infrequent or unpredictable traffic. The first 1 million executions per month are free, though resource consumption still matters to pricing. section 8.2.3
  • Scaling to zero can mean a cold start after an idle period. If immediate execution matters more, Premium keeps prewarmed instances ready but charges for reserved capacity. section 8.2.3
  • If you need more control over memory, scaling, or networking while retaining serverless billing, compare Flex Consumption. The classic Consumption plan does not support VNet integration. section 8.2.3

Create an image-resizing Function App

In the Azure Portal, find Function App, select Add, and choose Consumption. Enter a subscription, resource group, name, runtime, and region. One example uses .NET 8 (LTS) with the isolated worker model. On the Storage step, configure a storage account in the Function App’s region. The app needs storage for tasks such as trigger and binding metadata, code files, and logs; the plan does not remove that dependency. section 2.2.16

Table 8.3 Azure Function pricing for various hosting options

Hosting option

Key features and use cases

Cost model

Consumption

Cost effective, scales to zero; suitable for infrequent or bursty workloads

Per execution and resource consumption (first 1 million executions/month free)

Premium

Fast, warm instances; long execution and virtual network (VNet) access; higher cost

Per vCPU-second and gigabyte-second of allocated instances (always running)

Flex Consumption

Serverless with more control—memory, scaling, VNet, reduced cold starts

Per execution and allocated memory; charges for always-ready instances if used

Dedicated

Predictable pricing; use existing Azure App Service infrastructure

Fixed monthly price for chosen App Service plan tier

Container Apps

Full container flexibility within serverless microservices ecosystem

Per active vCPU-second and memory-­second; scale to zero when idle

Compare Consumption’s per-execution pricing and free allowance with the different cost models of the other Azure Functions hosting options. section 8.2.3

How Microsoft Azure in Action covers it

How deep it goes
Explains scaling, billing, cold starts, and portal setup, but defers detailed Function App treatment.
Examples
Uses an image-resizing Function App configured through the Azure Portal.
What it assumes
Starts with subscription and resource-group choices while explaining what a Function App and its storage account do.
What you can do after
Operate/configure it in the Azure Portal and evaluate whether cold starts justify another hosting plan.
How it connects
Connects Function Apps, Azure Storage, triggers, cold starts, Premium, and Flex Consumption.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Microsoft Azure in Action. The section links point to the parts of the book it draws on.