Project: Containerized Web Application

Learn how to set up monitoring for a containerized Web application.

In this chapter project, you’ll be starting from a common position many DevOps pros start with: a web application running in a containerized environment. No one knows the health of the application until customer service gets hammered with calls about the app being down. Because of this, you decide to move to Azure Container Instances (ACI) for creating Docker containers.

Creating an Azure container instance

Since this project isn’t going to be centered around monitoring, but improving a web application’s reliability, let’s first create an ACI for a web application. Container instances are a way to run Docker containers in the cloud. You can run any container image and specify the CPU and memory requirements of the application. For this project, you will be using an Nginx web application.

Open up your favorite code editor and paste in the following code. Be sure to replace your_resource_group with an Azure resource group of your choosing.

The Azure CLI snippet below is creating a single Docker container running the NGinx web server with a single CPU and 1GB of memory.

az container create -g 'your_resource_group' `
                    --name 'nginx-web-app' `
                    --image 'nginx' `
                    --cpu 1 `
                    --memory 1

When the above command is finished, open up a web browser, and go to the Container Instances blade. You should see a Docker container running similar to the screenshot below. If so, you have successfully created a Docker container running NGinx.

Get hands-on with 1400+ tech skills courses.