Azure Serverless Hosting Plans

Many companies seriously discuss going Serverless and yet often end up with containers hosted on paid virtual machines. It is definitely the right step towards a Serverless architecture for anyone who would like to walk the path carefully. However, containers on virtual machines may not be what many require as you are still responsible for maintaining the virtual machines.

Let’s look at some of the fully managed solutions we have today in Azure and how it could be useful in hosting a web application that has an Angular frontend and a .NET Core backend. We will evaluate these options based on the following criteria – Cost, Development/Deployment effort and Supported features.

Static Website

Probably, Static Website is one of the main features in Azure that is often overlooked by everyone. As the name suggests this is useful only for hosting and delivering static files. If you have the frontend developed using a framework like Angular, then you can host it as a Static Website in Azure instead of using a dedicated hosting solution. Static websites are a feature of Azure blob storage and hence they charge only for the blob storage usage. Most likely you are going to pay the price of a coffee for hosting a static website for a month.

Azure Container Instances

Of all the solutions offered in Azure for hosting containers, ACI is the simplest of all. However, it is probably not useful in most of the production scenarios mainly considering that this does not provide any auto scaling support. There are scenarios where the scalability requirements are not unknown, like running a scheduled task daily, hosting a long running background task to avoid contentions in the main service etc. In these situations, it is cost efficient to use ACI as it offers per second billing and the cost is as low as $0.0000207‬ per second for a container that uses 1 GB memory and 1 vCPU.

Web App For Containers

Azure App Service is the closest to a feature that provides Virtual Machines as a Service. App Service offers you all the features like auto scaling, load balancing and security that is required for hosting frontend/backend solutions, Containers, etc. and also seamless deployment by providing integration with various CI/CD providers. App Services are therefore the costliest of all the options listed here offering only monthly plans and not per second billing model.

This is still an attractive feature because multiple web apps/containers can be hosted in the same plan if the plan’s capacity is underutilized. The support for Windows containers is in Preview as of writing this post and only offers premium plans. However, it supports Linux OS in production and offers multiple hosting plans.

Azure Functions

Azure Functions is probably one of the first and main serverless options Azure released. Designed with scalability, security and seamless integration with other Azure features at heart, Az Functions offers per second billing model too. It provides 400,000 GB-s of free usage every month under the Consumption plan.

Az Functions can be developed using one of the many supported programming languages like C# and Javascript. Even though the development using .Net Core is very similar to that of creating a Web Api, it does not use the same hosting or startup models for obvious reasons. Therefore certain features like OData are not supported out of the box. Having a very active community for Azure, it is not difficult to find solutions for these limitations.

Many sees Az Functions as a Vendor specific solution as it requires you to write the code using its framework and raises this as a main blocker. Though it is true, this should be a concern only if there are uncertainties around using Azure as a long term hosting provider. Even in the worst case, Az Functions can be easily migrated to a container based solution, provided the business logic are properly created in modules separate from the ones that deal with the function trigger point. Az Function is one of the best serverless options we have in Azure today as it offers all the essential features required for an easy development, deployment and hosting for a relatively low price.

Azure Kubernetes Service

You cannot talk serverless or microservices hosting without mentioning Kubernetes. AKS is relatively a new feature from Azure for providing a fully managed solution for container orchestration using Kubernetes. You can use a kubernetes manifest file to define the orchestration parameters and use this to control how the containers scale. For much more control in an enterprise environment, one can use a Kubernetes package manager like Helm charts which supports reusability across the teams using templates.

On a high level, the costing plans are similar to that of Web App for Containers in that you have to pay monthly for the virtual machines. On the other side, you have much more control on the scalability parameters using Kubernetes. Of course, this adds some complexity to the application as it has a steep learning curve.

Summary

Azure offers multiple cost effective serverless solutions that are useful in wide variety of scenarios. Hosting application containers on virtual machines is definitely a valid solution but the high maintenance cost may not be justifiable for many use cases especially for small and medium businesses. We saw a few hosting solutions that varies from “low cost – less features” to “high cost – more features”. And the only prerequisite of using most of these solutions is having a docker image to create a container. What stops you from moving to one of these solutions and reducing the infrastructure cost, if you haven’t already?

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.