Startups get up to $50k in free compute credits.
May 22, 20257 minute read
Azure Functions pricing: Consumption vs. Flex Consumption
author
Kenny Ning@kenny_ning
Growth Engineer

Azure Functions is a flexible and cost-effective serverless solution for running your code in the cloud. This guide breaks down the differences between the two main plans: Consumption and Flex Consumption.

Consumption vs. Flex Consumption

Azure Functions comes in two pay as you go plans:

  1. Consumption plan: The original offering, priced based on function execution time and total number of executions.
  2. Flex Consumption plan: Azure’s newer offering with more flexibility and features, including “Always Ready” instances, memory configuration, and virtual network integration.

Overall, the Flex Consumption plan is slightly more expensive than the base Consumption Plan but offers more features and better functionality. Azure officially recommends this plan over the original Consumption plan.

Consumption plan pricing

Consumption plan Azure Functions are priced based on the following components (East US region):

  1. Execution Time: $0.000016 per GB-second (first 400,000 GB-s per month free)
  2. Total executions: $0.20 per million executions (first 1 million executions per month free)

The cost of the individual components are added together to get the total cost.

Instance sizes are non-configurable and limited to 1.5 GB.

Interestingly, this pricing model and rates are identical to AWS Lambda pricing.

Pricing example

Let’s say your function runs 3 million times per month for 1 second each time:

CalculationTotal
Execution Time3 million executions x 1 second x 1.5 GB4,500,000 GB-s
Billable Execution Time4,500,000 GB-s - 400,000 GB-s4,100,000 GB-s
Execution Time Cost4,100,000 GB-s x $0.000016$65.60
Billable Executions3 million - 1 million2 million
Executions Cost2 x $0.20$0.40
Total Cost$65.50 + $0.40$66.00

Flex Consumption plan pricing

Like the base Consumption plan, Flex Consumption charges by Execution Time and Total Executions, but at higher base rates.

  1. Execution Time: $0.000026 per GB-second (first 100,000 GB-s per month free)
  2. Total Executions: $0.40 per million executions (first 1 million executions per month free)

If you use the Always Ready feature (pre-provisioned instances), the pricing is slightly different:

  1. Baseline: $0.000004 per GB-second (first 100,000 GB-s per month free)
  2. Execution Time: $0.000016 per GB-second
  3. Total Executions: $0.40 per million executions

You will be billed at the “Baseline” rate based on the memory you select, even for idle time.

Resource allocation

The default instance size is 2,048 MB (2 GiB). The other options are 512 MB and 4,096 MB.

Flex Consumption pricing example

Let’s say your function runs for 1 second with 2,048 MB of allocated memory 3 million times per month, but with Always Ready enabled. Note that with Always Ready enabled, there is no free grant.

CalculationTotal
Baseline Time2,592,000 seconds (30 day month) x 2 GB5,184,000 GB-s
Baseline Cost5,184,000 GB-s x $0.000004$20.74
Execution Time3 million executions x 1 second x 2 GB6,000,000 GB-s
Execution Time Cost6,000,000 GB-s x $0.000016$96.00
Executions Cost3 x $0.40$1.20
Total Cost$20.74 + $96.00 + $1.20$117.94

Ship your first app in minutes.

Get Started

$30 / month free compute