The next horizon in cloud computing is here: “Serverless Computing,” which is set to take the benefits of cloud computing to a new level, further reducing IT operational costs, allowing your organization to deploy services faster, and ultimately making you more nimble and responsive to customer requirements.
Despite the name “serverless,” this does not actually involve running code without servers. Instead it means that the business using the system is not responsible for purchasing, renting, or provisioning the servers or virtual machines upon which the code will run. Those resources are transparently allocated at runtime as they become available by the cloud provider via its serverless paradigm.
With Azure Functions you get a slice of a common virtual machine (VM) that is managed by Azure, for the brief period you need to run your custom functions code. As well as the improved VM cost efficiency you get with the service, I was blown away by how simple it is to quickly drop in small pieces of custom code to do discrete tasks. What’s more, Azure Functions easily integrates with other services to form a powerhouse solution.
With Azure Functions, you don’t have to allocate a VM. Nor do you have to create a special run-time environment, or worry about resource, scaling or VM lifetime management. Choose your favorite language, import function libraries using NuGet, and integrate seamlessly with various SaaS services and other Azure services. Either use various triggers or events to invoke your functions, or set them to run on a timed basis. Define input and output bindings for the flow of data and objects in and out of your Azure Functions. Functions can be implemented and deployed using Visual Studio or can be created directly using the Azure Portal blade for Functions App.
Plan vs App Service Plan
There are two models of allocation for Azure serverless computing: the Consumption Plan and the App Service Plan. Only the consumption-based Azure Functions model is truly serverless, while with the Azure App Service plan you still pay for resources and VMs.
Using the Azure Consumption Plan, we see true serverless computing. In this model, you pay per execution and only for the resources your function consumes, with dynamic scaling available if needed. It is a cloud-based concept where the cloud provider fully manages starting and stopping of a VM upon which a function will run to serve requests. Those requests are billed by an abstract measure of the resources required to satisfy the request, rather than per virtual machine, per hour. Scaling out is something that is automatically managed for you by Azure.
If your workloads are intermittent, or short running in nature, the Consumption Plan makes sense for your Azure Functions. When a functions app becomes idle after a short time (about five minutes as of today), running instances will turn down to zero. Then, when it needs to run again, it can take time to reload, resulting in latency. To avoid this delay, you can either use a regular App Service Plan with always-on enabled for Functions App, or use another mechanism to trigger one of the functions in Functions App once at least every five minutes to keep it running.
Fellow Consulting AG can help you tap into the benefits of Azure’s serverless cloud functionality.
For more information, refer to Azure Functions.
For more information on choosing the correct service plan for Azure Functions, refer to https://docs.microsoft.com/en-us/azure/azure-functions/functions-scale.
For more information in best practices for Azure functions, refer to tips for improving the performance and reliability of Azure Functions.