Containers are no longer the best kept secret in IT. Practically everywhere I go, I hear of organizations using containers for everything from small projects to mission critical 24×7 applications with 99.999% uptime SLA’s. These kinds of projects all have a myriad of different requirements and drivers that go into making the decision of where and how to run containers. To meet these demands, the containers as a service offering on clouds began diversifying. Containers on Azure started off with a fairly basic offering: Azure Container Services, which supported what at the time was considered to be the cutting edge of containers for orchestration, namely Docker Swarm and DC/OS. And short of this option, there really wasn’t much else. But this quickly changed when Microsoft doubled down on containers. Now, the bet has paid off and Microsoft has matured well beyond this initial offering to become a leader in the containers as a service among cloud providers. Microsoft has 5 different containers as a service services to choose from and a suite of other tools that help make running containers easy. Knowing what these are and when to use them can help find the solution that best meets the needs of your applications.
Container Instances – Azure Container Instances is the easiest way to run containers on Azure. Either through the Azure Portal or through one of the many automation tools on Azure, you can quickly and easily spin up single containers that can scale quickly. With container instances, you don’t have to have any special orchestration tools or any need to interact with or even configure the environment they are running in. Likewise, Container Instances supports persistence through Azure File Services for containers that need to persist data.
When to use: Use Azure Container Instances for simple, single-container deployments that don’t need integration with other parts of Azure like VNets.
Web Apps for Containers – Azure Web Apps for Containers allows you to run containers in the context of Azure App Services. These containers have all the features of App Services at their disposal and can scale up and out just like App Services do. Likewise, these also can be easily integrated with other features on Azure through App Services like VNet integration, Azure App Insights, and other services. Also, Web Apps for Containers has preview support for multi-container applications which can be defined using Docker Compose YAML files or Kubernetes Resource Files.
When to use: Use Azure App Services for Containers when you need to host containerized web apps on Azure. Because containers can run practically any platform, this opens up the possibility of running apps that wouldn’t otherwise be able to run on App Services.
Azure Batch + Batch Shipyard – Azure Batch is a service that lets you run long running batch jobs on dedicated compute resources. Batch Shipyard is an addon component for Azure Batch that allows Azure Batch workloads to run in containers. This enables users to prevision the containers with all of the needed software then simply pull the container when the job starts rather than having to build out the environment before the batch process can be run.
When to use: Azure Batch with Batch Shipyard is intended for batch processes, so it is useful when you need to run jobs such as big data workloads, reports, long running tasks, or CPU intense processes.
Service Fabric – Service Fabric is a homegrown microservice framework that has its own model for running microservices natively written for Service Fabric as well as the ability to run containers. The Service Fabric engine provides orchestration, monitoring, scaling, and healing for services running on Service Fabric.
When to use: Service Fabric for containers is useful for people already familiar with Service Fabric and want to use containers to host microservices.
Azure Kubernetes Services (AKS) – AKS is the flagship container offering on Azure. It is a fully managed Kubernetes and standards-based implementation that integrates well with other Azure service like Azure VNets, Load Balancers, Application Gateways, Azure File Storage, Azure Manage Disks and Azure Blob Storage without having to actually do anything beyond define references to these resources in Kubernetes resource files. This makes AKS a best-in-class offering for hosting all kinds of applications from web apps, databases, caching clusters, and numerous other options. Creating an AKS cluster is easy, scaling up and down is simple, and you only have to pay for the compute nodes.
When to use: AKS is the general-purpose container offering and can be tuned for large and small apps alike. It is the best choice when one of the more aforementioned niche services won’t work for the given app.
There are a few other services worth mentioning that amend the aforementioned container offerings.
Azure Container Registry (ACR) – ACR is a Blob Storage backed container registry as a service on Azure that allows you to host your own images as in either public or private repositories. It also has integration with third parties for security scanning and the ability to integrate with other services through webhooks so automation can happen when new container images are pushed. ACR also supports geo-replication of images to ensure container images are highly available.
When to use: Use ACR when you need to manage custom container images in a secure way.
Azure Arc – Azure Arc is a brand-new service in Azure announced at Ignite 2019. Arc is not so much a platform for running containers as it is a set of tools that allows you to extend, operationalize and manage multisite setups that extend beyond Azure such as your on-premise datacenter or into other clouds. Arc can manage Kubernetes based applications on these extensions.
When to use: Use Arc when you want to manage multiple sites running Kubernetes through a centralized management system.
AKS Engine – AKS Engine is the secret sauce behind AKS. Microsoft has made the same engine used to deploy AKS on Azure as a service available to users. AKS helps ease the creation of a container cluster on virtual machines running on Azure by automating the process. One simply needs to define the cluster’s parameters and AKS does the rest.
When to use: Use AKS Engine when running containers on Azure as a service is not an option.
Conclusion
So, there are the options for running containers on Azure. There are no hard and fast rules that says which of the services will work best for your application, and in some cases two of the services may be equally viable. In that case, the best thing to do then would be to implement both and see which will work best for your application.