- Print
- DarkLight
- PDF
Azure Function Hosting Costs
- Print
- DarkLight
- PDF
In a previous Azure Function tip, we discussed hosting options: consumption plan (pay-as-you-go) or app service plan (based on tier). Today there are three types of hosting options for Azure Functions: consumption, premium, and app service plan. With the latter, you now also have the option for a dedicated plan allowing you to further isolate the hosting of web apps and Azure Functions.
Consumption plan costs are based on the consumption of resources and for functions Microsoft measures executions. For a single function, the execution is measured in GB-seconds, a calculation of memory usage and execution time. In case your function runs 5 seconds and consumes 0.5 Gb of memory the execution cost is: 5 * 0.5 = 2.5 GB-seconds. Hence, you can predict costs on your workloads using the Azure Price calculator. Assume you have 100 million execution per month than the price would be ~ 20 USD.
In case, you opt for premium (enhanced performance and VNET integration) for hosting your Azure functions, the pricing is different:
Premium pricing depends on instance type you choose, number of instances, and additional scale units.
Pricing with a dedicated app service plan (optimize capacity, isolation, custom images) is even higher and depends on the instance type.
Which plan you choose depends on what performance- and cost requirements you have (the scale and hosting option on Microsoft docs is a useful resource).