There are three different hosting plans available for Azure Functions for deploying and those are Consumption plan (Serverless), Premium plan, and App service plan. In this article we discuss about each plan usage.
While choosing the plan we have to consider about our function app usage, availability, scalability, performance, and many other factors.
Consumption or Serverless Plan: With this plan, instances of Azure Functions are automatically added and removed based on the function usage. Unlike App service, Consumption plan charges you only for the function execution time and it won’t charge for idle time. Azure will scale out automatically even during high load time.
Consumption plan aggregates the billing across all functions within the Function app. Function execution will get timeout after a configurable amount of time, 5 minutes by default. We can increase this time to maximum of 10 minutes irrespective of run-time version. Different Function apps from the same regions can be assigned to same consumption plan to simplifies the billing and no impact of having multiple functions apps running in the same consumption plan.
Premium Plan: This plan also function instances are automatically added and removed based on usage like consumption plan. Premium plan warms the instances continuously to avoid any cold start. It provides execution time out as 30 minutes by default and unlimited time maximum (60 minutes guaranteed). Unlike consumption plan, premium plan billing is based on the number of core seconds, memory used across instances and pre-warmed instances instead of charging just for execution time and memory used. With premium plan, we can easily predict the billing amount as compared with consumption plan.
Use the premium plan instead of consumption plan when below is required for your function app.
- Function App takes more than 10 minutes to execute
- When VNet (Virtual Network) connectivity is required
- When you need more CPU’s or memory than the consumption plan offers
- When Function App requires to run continuously
App Service Plan: With this plan, functions can also run in the same dedicated VM’s as other App Service apps. This plan charges you like other App service apps, that means it charges you for resource available time instead of resource running time. Use this plan when you have underutilized VM’s and when your function requires unlimited execution time.
If you want to find the hosting plan for your existing Function App, check App Service plan / pricing tier under Overview.