You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-functions/functions-consumption-costs.md
+20-19Lines changed: 20 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,42 +10,30 @@ ms.custom:
10
10
11
11
# Estimating consumption-based costs
12
12
13
-
This article shows you how to estimate plan costs for the Consumption and Flex Consumption hosting plans.
13
+
This article shows you how to estimate plan costs for the Flex Consumption and Consumption hosting plans.
14
14
15
-
Azure Functions currently offers four different hosting plans for your function apps, with each plan having its own pricing model:
15
+
Azure Functions currently offers these different hosting options for your function apps, with each option having its own hosting plan pricing model:
16
16
17
17
| Plan | Description |
18
18
| ---- | ----------- |
19
-
|[**Consumption**](consumption-plan.md)| You're only charged for the time that your function app runs. This plan includes a [free grant][pricing page] on a per subscription basis.|
20
-
|[**Flex Consumption plan**](flex-consumption-plan.md)| You pay for execution time on the instances on which your functions are running, plus any _always ready_ instances. Instances are dynamically added and removed based on the number of incoming events. Also supports virtual network integration. |
19
+
|[**Flex Consumption plan**](flex-consumption-plan.md)| You pay for execution time on the instances on which your functions are running, plus any _always ready_ instances. Instances are dynamically added and removed based on the number of incoming events. This is the recommended dynamic scale plan, which also supports virtual network integration. |
21
20
|[**Premium**](functions-premium-plan.md)| Provides you with the same features and scaling mechanism as the Consumption plan, but with enhanced performance and virtual network integration. Cost is based on your chosen pricing tier. To learn more, see [Azure Functions Premium plan](functions-premium-plan.md). |
22
21
|[**Dedicated (App Service)**](dedicated-plan.md) <br/>(basic tier or higher) | When you need to run in dedicated VMs or in isolation, use custom images, or want to use your excess App Service plan capacity. Uses [regular App Service plan billing](https://azure.microsoft.com/pricing/details/app-service/). Cost is based on your chosen pricing tier.|
22
+
|[**Container Apps**](functions-container-apps-hosting.md)| Create and deploy containerized function apps in a fully managed environment hosted by Azure Container Apps, which lets you rRun your functions alongside other microservices, APIs, websites, and workflows as container-hosted programs. |
23
+
|[**Consumption**](consumption-plan.md)| You're only charged for the time that your function app runs. This plan includes a [free grant][pricing page] on a per subscription basis.|
You should always choose the plan that best supports the feature, performance, and cost requirements for your function executions. To learn more, see [Azure Functions scale and hosting](functions-scale.md).
27
+
You should always choose the option that best supports the feature, performance, and cost requirements for your function executions. To learn more, see [Azure Functions scale and hosting](functions-scale.md).
27
28
28
-
This article focuses on Consumption and Flex Consumption plans because in these plans billing depends on active periods of executions inside each instance.
29
+
This article focuses on Flex Consumption and Consumption plans because in these plans billing depends on active periods of executions inside each instance.
29
30
30
31
Durable Functions can also run in both of these plans. To learn more about the cost considerations when using Durable Functions, see [Durable Functions billing](./durable/durable-functions-billing.md).
31
32
32
33
## Consumption-based costs
33
34
34
35
The way that consumption-based costs are calculated, including free grants, depends on the specific plan. For the most current cost and grant information, see the [Azure Functions pricing page](https://azure.microsoft.com/pricing/details/functions/).
35
36
36
-
### [Consumption plan](#tab/consumption-plan)
37
-
38
-
The execution *cost* of a single function execution is measured in *GB-seconds*. Execution cost is calculated by combining its memory usage with its execution time. A function that runs for longer costs more, as does a function that consumes more memory.
39
-
40
-
Consider a case where the amount of memory used by the function stays constant. In this case, calculating the cost is simple multiplication. For example, say that your function consumed 0.5 GB for 3 seconds. Then the execution cost is `0.5GB * 3s = 1.5 GB-seconds`.
41
-
42
-
Since memory usage changes over time, the calculation is essentially the integral of memory usage over time. The system does this calculation by sampling the memory usage of the process (along with child processes) at regular intervals. As mentioned on the [pricing page], memory usage is rounded up to the nearest 128-MB bucket. When your process is using 160 MB, you're charged for 256 MB. The calculation takes into account concurrency, which is multiple concurrent function executions in the same process.
43
-
44
-
> [!NOTE]
45
-
> While CPU usage isn't directly considered in execution cost, it can have an impact on the cost when it affects the execution time of the function.
46
-
47
-
For an HTTP-triggered function, when an error occurs before your function code begins to execute you aren't charged for an execution. This means that 401 responses from the platform due to API key validation or the App Service Authentication / Authorization feature don't count against your execution cost. Similarly, 5xx status code responses aren't counted when they occur in the platform before your function processes the request. A 5xx response generated by the platform after your function code has started to execute is still counted as an execution, even when the error isn't raised from your function code.
@@ -94,6 +82,19 @@ In a situation like this, the pricing depends more on the kind of work being don
94
82
95
83
In this scenario, the total hourly cost of running on-demand on a single instance is `$0.1152 + $0.0288 = $0.144 USD`.
96
84
85
+
### [Consumption plan](#tab/consumption-plan)
86
+
87
+
The execution _cost_ of a single function execution is measured in _GB-seconds_. Execution cost is calculated by combining its memory usage with its execution time. A function that runs for longer costs more, as does a function that consumes more memory.
88
+
89
+
Consider a case where the amount of memory used by the function stays constant. In this case, calculating the cost is simple multiplication. For example, say that your function consumed 0.5 GB for 3 seconds. Then the execution cost is `0.5GB * 3s = 1.5 GB-seconds`.
90
+
91
+
Since memory usage changes over time, the calculation is essentially the integral of memory usage over time. The system does this calculation by sampling the memory usage of the process (along with child processes) at regular intervals. As mentioned on the [pricing page], memory usage is rounded up to the nearest 128-MB bucket. When your process is using 160 MB, you're charged for 256 MB. The calculation takes into account concurrency, which is multiple concurrent function executions in the same process.
92
+
93
+
> [!NOTE]
94
+
> While CPU usage isn't directly considered in execution cost, it can have an impact on the cost when it affects the execution time of the function.
95
+
96
+
For an HTTP-triggered function, when an error occurs before your function code begins to execute you aren't charged for an execution. This means that 401 responses from the platform due to API key validation or the App Service Authentication / Authorization feature don't count against your execution cost. Similarly, 5xx status code responses aren't counted when they occur in the platform before your function processes the request. A 5xx response generated by the platform after your function code has started to execute is still counted as an execution, even when the error isn't raised from your function code.
0 commit comments