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-costing.md
+10-8Lines changed: 10 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ manager: gwallace
12
12
13
13
# Estimating Consumption plan costs
14
14
15
-
There are currently three types of hosting plans for app that run in Azure Functions, with each plan having its own pricing model:
15
+
There are currently three types of hosting plans for an app that run in Azure Functions, with each plan having its own pricing model:
16
16
17
17
| Plan | Description |
18
18
| ---- | ----------- |
@@ -28,9 +28,9 @@ This article deals only with the Consumption plan, since this plan results in va
28
28
29
29
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.
30
30
31
-
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 just `0.5GB * 3s = 1.5 GB-seconds`.
31
+
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`.
32
32
33
-
Because 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.
33
+
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.
34
34
35
35
> [!NOTE]
36
36
> 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.
@@ -39,7 +39,7 @@ To fix a lower bound on your estimates, it's useful to know the minimum costs of
39
39
40
40
## Other related costs
41
41
42
-
When estimating the overall cost of running your functions in any plan, remember that the Functions runtime uses several other Azure services, which are each billed separately. When pricing a Functions-base topology, any triggers and bindings you have that integrate with other Azure services require you to create and pay for those additional services.
42
+
When estimating the overall cost of running your functions in any plan, remember that the Functions runtime uses several other Azure services, which are each billed separately. When calculating pricing for Functions apps, any triggers and bindings you have that integrate with other Azure services require you to create and pay for those additional services.
43
43
44
44
For functions running in a Consumption plan, the total cost is the execution cost of your functions, plus the cost of bandwidth and additional services.
45
45
@@ -95,16 +95,18 @@ The resulting chart contains the totals for both execution metrics in the chosen
95
95
96
96

97
97
98
-
Because the number of execution units is so much greater than the execution count, the chart just shows execution units.
98
+
As the number of execution units is so much greater than the execution count, the chart just shows execution units.
99
99
100
100
This chart shows a total of 1.11 billion `Function Execution Units` consumed in a two-hour period, measured in MB-milliseconds. To convert to GB-seconds, divide by 1,024,000. In this example, the function app consumed `1,110,000,000 / 1,024,000 = 1,083.98` GB-seconds. You can take this value and multiply by the current price of execution time on the [Functions pricing page][pricing page], which gives you the cost of these two hours, assuming you've already used any free grants of execution time.
101
101
102
102
### Azure CLI
103
103
104
-
The [Azure CLI](/cli/azure/) has commands for retrieving metrics. You can use the CLI from a local command environment or directly from the portal using [Azure Cloud Shell](../cloud-shell/overview.md). For example, the following [az monitor metrics list](/cli/azure/monitor/metrics#az-monitor-metrics-list) command returns hourly data over same time period used before:
104
+
The [Azure CLI](/cli/azure/) has commands for retrieving metrics. You can use the CLI from a local command environment or directly from the portal using [Azure Cloud Shell](../cloud-shell/overview.md). For example, the following [az monitor metrics list](/cli/azure/monitor/metrics#az-monitor-metrics-list) command returns hourly data over same time period used before.
105
+
106
+
Make sure to replace `<AZURE_SUBSCRIPTON_ID>` with your Azure subscription ID running the command.
105
107
106
108
```azurecli-interactive
107
-
az monitor metrics list --resource /subscriptions/XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXX/resourceGroups/metrics-testing-consumption/providers/Microsoft.Web/sites/metrics-testing-consumption --metric FunctionExecutionUnits,FunctionExecutionCount --aggregation Total --interval PT1H --start-time 2019-09-11T21:46:00Z --end-time 2019-09-11T23:18:00Z
109
+
az monitor metrics list --resource /subscriptions/<AZURE_SUBSCRIPTION_ID>/resourceGroups/metrics-testing-consumption/providers/Microsoft.Web/sites/metrics-testing-consumption --metric FunctionExecutionUnits,FunctionExecutionCount --aggregation Total --interval PT1H --start-time 2019-09-11T21:46:00Z --end-time 2019-09-11T23:18:00Z
108
110
```
109
111
110
112
This command returns a JSON payload that looks like the following example:
@@ -236,4 +238,4 @@ customMetrics
236
238
> [Learn more about Monitoring function apps](functions-monitoring.md)
0 commit comments