Home > other >  Why Consumption Azure Functions create an App Service Plan and Storage Account?
Why Consumption Azure Functions create an App Service Plan and Storage Account?

Time:04-06

When you create an Azure Function Consumption App the platform automatically creates an App Service Plan which is the free one. Isn't the consumption Functions meant to be scalable and serverless so you don't have to deal with server farms?

CodePudding user response:

Please see this documentation: Azure Functions Consumption plan hosting.

When you're using the Consumption plan, instances of the Azure Functions host are dynamically added and removed based on the number of incoming events. The Consumption plan is the fully serverless hosting option for Azure Functions.

[...]

The general recommendation is for each function app to have its own Consumption plan. However, if needed, function apps in the same region can be assigned to the same Consumption plan.

So it is scalable, it is serverless and you do not deal with server farms. You just specify a Consumption plan and you're good to go!

By default, a Consumption plan is created for you. You do not have any options for configuring resources or scaling the App Service plan, it's just there to enable your Functions to run in a Consumption plan.

Educated guess:
This might be necessary since a Function App is a special version of an App Service. Like an App Service needs an App Service Plan, a Function App needs an App Service Plan too.
Just for laughs, open the Azure portal to a subscription that has Function Apps and open up the App Services. See the Function Apps in that list...?

As far as the storage account goes,

Azure Functions requires an Azure Storage account when you create a function app instance.

[...]

When creating a function app, you must create or link to a general-purpose Azure Storage account that supports Blob, Queue, and Table storage. This is because Functions relies on Azure Storage for operations such as managing triggers and logging function executions.

More info: Storage considerations for Azure Functions.

  • Related