Web App For Containers

Getting Started

Web App for Containers is a great Azure offering that helps developers package their application and all related dependencies in a container and then host the container on the Web App. Hosting non-Microsoft applications (like the ones developed using Java, Python or PHP) on Web App is quite challenging due to the complex dependencies on other libraries that have to be installed on the Web App as well.

For example, if we are deploying a Python application that depends on libraries like Flask and Numpy on Web App, then these dependencies should be installed first on the Web App and then the Python code base. Installing these dependencies is very tedious. Web App for containers comes as a great rescue here. In this scenario, flask and numpy can be installed on the container first and then the Python application can be configured on the container. Once the container is ready and the application is tested, it can be hosted on the Web App. This approach is much easier and quicker.

Web App for containers supports hosting a Single Container from Azure Container Registry or Docker Hub or from a private registry. Docker composes a configuration file or a Kubernetes Pod definition file can also be used to host the customized container.

As of now, this offering is available on the Linux platform.

Creating a Web App for Containers

Now, let us quickly get into the steps on how to create a Web App for Containers. It is quite simple and easy to create one using the Azure portal. In this demo, we will use the default quickstart container.

Let us first log in to Azure portal, search for Web App for Containers in the marketplace, and select it.

Azure
 
Click on the "Create" button.

Azure 

Provide App Name, Subscription, Resource Group and App Service Plan. Click on Configure container.

Azure 

Here, we can see different options available from where we can host a container. Click on "Single Container" tab and click on "Docker Hub". Click the "OK" button We will host a default Docker image sample-hello-world. In the real world, a Docker Container image will be created with all the dependencies installed and the application hosted on it. And this image is provided here in the Image and optional tag textbox.

Azure
 
Click on OK button to create the Web App with this default sample-hello-world container hosted.
 
Azure 
 
Now when we browse the Web App url then the default Application hosted opens up.

Azure 

Wrapping Up

In this article, we created a Web App for containers using a default image from Docker Hub. It would be fun trying out hosting a container using Docker Compose or Kubernetes using the default quick start configuration provided. Please note that Docker Compose and Kubernetes are preview offerings now (when the article is being published). Have due diligence done in case you are planning to get these implemented in Production. However, Singe Container option is generally available.