AWS vs Azure: deploying containers

AWS vs Azure: deploying containers

In this blog post, we'll look at two options to quickly get started deploying container applications to AWS and Azure. Start learning today!

Author: Carlos Souza


Get started with container applications on AWS and Azure

It’s not an exaggeration to say container technology has revolutionized the way software teams deploy applications to the cloud. At the same time, provisioning an infrastructure targeted towards container processes can be quite challenging. Lucky for us developers and IT Ops pros, cloud vendors have created services which abstract away much of the heavy lifting needed for running containers.

In this blog post, we’ll look at two options to quickly get started deploying container applications to AWS and Azure. By the end of this post you will have a better understanding of how to work with containers in both AWS and Azure, and more information to help you decide which one is the best cloud service provider for your use case.

AWS: Elastic Beanstalk

One of the simplest ways to deploy container applications to the AWS cloud is using Elastic Beanstalk. This service supports a variety of runtime technologies. As of this writing, the following are supported: Python, PHP, Go, Ruby, Java, .NET on Windows Server, .NET Core on Linux and Docker.

The official Beanstalk documentation states that, “By using Docker with Elastic Beanstalk, you have an infrastructure that handles all the details of capacity provisioning, load balancing, scaling and application health monitoring.” For deploying single container applications to Beanstalk, all you need is a Dockerfile. For more complex applications involving multiple containers, Beanstalk allows us to leverage features from Docker Compose through the use of a docker-compose.yml file.

Each Beanstalk environment creates and manages a handful of underlying AWS services, such as Elastic Load Balancers, Auto-Scaling Groups, EC2 instances and Docker daemons.

Support is available for both public and private container image repositories. As an alternative to the popular Docker Hub, which recently implemented limitations on free accounts, we can use AWS’s own Amazon Elastic Container Registry to store and pull container images.

The quickest way to get started using Docker on Beanstalk is with the Elastic Beanstalk CLI (EB CLI). Using the CLI, we can create and test an application in our local workstation, and then deploy and manage the application on AWS. The deployment process can (and should!) be automated through setting up a CI/CD Pipeline with AWS Code Pipeline. Code Pipeline detects changes to the source code repository and automatically initiates deployment to Beanstalk.

To quickly get started deploying container applications in AWS, checkout Beanstalk.

Azure: App Service

The service used for hosting and managing web applications at scale in Azure is called App Service. This service supports a variety of runtime languages for both Windows and Linux, and also container applications. App Service is to Azure what Beanstalk is to AWS.

The official App Service documentation says that, “App Service not only adds the power of Microsoft Azure to your application, such as security, load balancing, autoscaling and automated management. You can also take advantage of its DevOps capabilities, such as continuous deployment from Azure DevOps, GitHub, Docker Hub and other sources, package management, staging environments, custom domain and TLS/SSL certificates.”

In order to create an App Service, we use the Marketplace to search for App Service plan. An App Service plan defines a set of compute resources needed for a web app to run.

For those looking to simply experiment with container deployments in Azure, either one of the two base pricing tiers (Free and Shared) for the App Service Plan should work. These are free tiers and the resources cannot scale out, but allows us to try out the service before committing to payments. Once the App Service plan is created, we use the Marketplace to search for and create a Web App. This is the service used to deploy our web applications and which abstracts away all the complexity involved in provisioning the necessary infrastructure for running container processes.

In order to run a container in a Web App, the container image must be hosted on a registry from which the Web App can deploy. Currently supported registries include Azure Container Registry, Docker Hub or a private, self-hosted, registry. With the services in place and the image registry in hand, the container application is ready to be deployed to Azure. This tutorial from Microsoft shows step-by-step instructions on how to do so. To quickly get started deploying container applications to Azure, checkout App Service.

Conclusion

Both AWS and Azure offer services for quickly running containers in cloud environments. These services help hide the complexity involved in provisioning the required infrastructure, deploying and monitoring container processes. If you are more comfortable with the AWS cloud, then checkout Beanstalk. If Azure is more of your liking, then App Service is the way to go. Either route you take, you will be standing in the shoulder of giants and much better off than rolling your own solution.



Related tags:

cloud   aws   azure   containers  
About the author

Full stack engineer, consultant, speaker and community organizer. Over 10 years of experience helping software teams deliver value to customers. AWS Certified DevOps Engineer.

10-day free trial

Sign Up Now