azurerm_linux_function_app cost estimation
A serverless function app. Three hosting plans with different cost models: Consumption (per-execution), Premium (always-warm), or App Service Plan (fixed).
An azurerm_linux_function_app runs serverless functions on Linux. The cost model depends entirely on which hosting plan the function app uses, set via the linked azurerm_service_plan.
Consumption plan (Y1 SKU): the true serverless tier. Bills per execution and per GB-second of compute time, just like AWS Lambda. - $0.20 per million executions (first 1M/month free) - $0.000016/GB-second of execution time (first 400,000 GB-seconds/month free) - Scales to zero between invocations - Cold starts up to a few seconds
Premium plan (EP1, EP2, EP3 SKUs): always-warm workers with pre-warmed instances. - Per-vCPU-hour and per-GB-RAM-hour, like Premium App Service plans - EP1 starts at ~$0.205/hour (~$150/month) for one always-on worker - No cold starts, supports VNet integration
Dedicated App Service Plan: function app shares a plan with web apps. Same per-hour rates as Standard or Premium App Service plans. Right when you have web apps and want to consolidate.
For most workloads, Consumption is right. The free tier alone covers a lot of usage: 1M executions and 400,000 GB-seconds per month, free across all functions in the subscription.
Triggers other than HTTP add charges through their respective resources (Service Bus, Event Hubs, Storage Queue, etc.).
c3x reads the linked service_plan_id to determine hosting tier. For Consumption, expected execution count and duration go in c3x-usage.yml.
Terraform example
A minimal but realistic configuration that C3X can estimate.
resource "azurerm_service_plan" "consumption" {
name = "function-consumption"
resource_group_name = azurerm_resource_group.main.name
location = azurerm_resource_group.main.location
os_type = "Linux"
sku_name = "Y1"
}
resource "azurerm_linux_function_app" "processor" {
name = "image-processor"
resource_group_name = azurerm_resource_group.main.name
location = azurerm_resource_group.main.location
service_plan_id = azurerm_service_plan.consumption.id
storage_account_name = azurerm_storage_account.functions.name
storage_account_access_key = azurerm_storage_account.functions.primary_access_key
site_config {
application_stack {
python_version = "3.11"
}
}
}Pricing dimensions
What you actually pay for when you provision azurerm_linux_function_app.
| Dimension | Unit | What's being charged |
|---|---|---|
| Consumption executions | per 1M executions | Each function invocation. First 1M/month free at subscription level. $0.20/1M executions |
| Consumption GB-seconds | per GB-second | Memory used × execution duration. First 400,000 GB-seconds/month free. $0.000016/GB-second |
| Premium plan | per worker per hour | Pre-warmed workers with VNet support. Charges continuously regardless of traffic. $0.205/hour for EP1 in eastus |
| Dedicated App Service Plan | per plan per hour | Shares the App Service Plan's rate. Right when consolidating function and web apps. |
Optimization tips
Common ways to reduce azurerm_linux_function_app cost without changing the workload.
Use Consumption plan for variable or low workloads
Up to 100% during idleConsumption scales to zero between invocations. For functions with <1M executions/month or sporadic load, Consumption is dramatically cheaper than Premium.
Right-size function memory
Workload-dependentAzure Functions runtime allocates memory per function. Profile your function and don't request more memory than needed. Memory directly drives the GB-second cost.
Use Durable Functions for long-running workflows
Workload-dependentPlain functions on Consumption have a 10-minute timeout. Durable Functions checkpoint state and let workflows run effectively unbounded while charging only for active execution time.
Move from Premium to Consumption if cold starts are tolerable
$150/month per Premium plan eliminatedPremium plan is ~$150/month minimum for the always-on worker. If your function tolerates 1-3 second cold starts, Consumption can save the entire Premium minimum.
FAQ
Consumption or Premium plan?
Consumption: variable or low traffic, cold starts OK, no VNet needed. Premium: predictable high-traffic, cold starts unacceptable, or VNet integration required. Crossover is around several hundred thousand executions per day at moderate duration.
How does c3x estimate Consumption cost?
Requires monthly_executions and average_duration_ms in c3x-usage.yml. c3x computes executions × per-1M rate plus GB-seconds × per-GB-second rate, applying the free tier.
What's the difference vs aws_lambda_function?
Almost identical pricing model. Azure Functions Consumption is slightly cheaper per GB-second ($0.000016 vs Lambda's $0.0000167) but has higher cold start times. Lambda has more mature integrations with AWS services; Functions has tighter integration with Azure services.
Does the linked Storage Account cost extra?
Yes. Function apps require an Azure Storage Account for triggers and state. The storage account is billed separately on aws_storage_account; usually tiny (~$1/month) for function-only use.
Related resources
Estimate this resource in your own Terraform
Free, open source, no API key. C3X parses your Terraform and shows line-item cost for every resource, including azurerm_linux_function_app.