Quick Overview: Azure Container Instances (Preview)

Windows containers are getting more and more popular. Azure already has multiple container-related features and more will be added in the near future. Today I quickly want to cover Azure Container Instances (ACI). This allows you to spin up containers on the Azure platform without even deploying a container host. Cool, huh?

The feature is now still in preview and has some limitations, this is why I only give a quick overview of the capabilities. I will not dive deep into the topic, but will definitely do that once the feature is ready. One important limitation you must know about is the fact, that you can only use containers that host long-running services, such as a web or SQL service. Containers that are built to execute a specific task and then exit will run into an “exit-and-restart” loop which is not what you want.

So for this example I use a simple container image that I pushed to Dockerhub. It is based on microsoft/aspnet and I just added a custom default.aspx file to it. If you don’t have an image to play, you can use mine by just pulling it down and take a look at it:

docker pull zehner/iisdemo

But in this blog post I will cover the process how to create a container on Azure, not on your local container host. So no need to pull it now. Instead I will go to portal.azure.com and start Cloud Shell (PowerShell). Once started, I create a new resource group for my container instance by using the Azure CLI. If you prefer, you can also use PowerShell cmdlets or the Azure portal.

az group create –name blog-iisdemo –location “West Europe”

image

Now I create a new Azure Container Instance based on my container image from Dockerhub.

az container create –name iisdemo –image zehner/iisdemo –resource-group blog-iisdemo –os-type Windows –ip-address public –port 80

image

The most important parameters are:

  • –image –> Image that should be used
  • –os-type –> Defines if this should be a Windows or Linux container
  • –ip-address public –> Assigns a public IP address to the container to make it reachable from outside
  • –port –> The port that will be published to access the process that runs inside the container – in this case the iis w3wp service

Important: The command that creates the new container instance is completed within some seconds. However, the container is not ready yet because the image needs to be pulled from the registry. Depending on the size of the image this can take a long time.

The status of the container will be “Waiting” and should later be changed to “Running” – again, this can take up to 15-20 minutes. Also check out the assigned public IP address of the container. This will be used to connect to the container once it is started.

image

When the container is ready, you can connect to the web site by using the assigned public IP address and you should see this:

image

This is just a simple example that demonstrates, how containers can be hosted in Azure without any additional infrastructure or configuration. Again, the service has some limitations, but Microsoft will definitely invest in this feature in the future to make it more valuable.

Make sure you also check out the Microsoft docs for more details and have fun spinning up your containers!

Cheers
Marce

This entry was posted in Azure, Container Management and tagged , , , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s