« Back to home

Windows containers on Azure Container Instance

If you're experimenting with Windows containers and want a super quick way to get started with running the containers you can't get anything easier than Azure Container Instances (ACI).

At MS Ignite 2017 Microsoft officially announced you can now run Windows containers on Azure Container Instances (it is still in preview though).

Its pretty easy to get started, especially with the command line interface (cli), we're using the Cloud Shell to make things even easier here.

First lets create a new resource group for our container instance (this is identical for linux or windows containers).

az group create --name aciRG --location westeurope create resource group Note: ACI is still in preview and not available in all regions

Now we can go ahead and create the container instance, here we're specifying the container image of shahid.azurecr.io/win/iis which is a nanoserver/iis image from the Docker hub that I pushed to the Azure Container Registry.
az container create --name iiscontainer --image shahid.azurecr.io/win/iis --os-type Windows --resource-group aciRG --ip-address public

The important bit here is that and we are telling ACI that its a Windows container with the --os-type Windows flag

create image

The cli spits out a load of information including the provisioning state of the deployment and the public IP address its been assigned.

After a few seconds the container is up and running and we can hit the public IP address to see the IIS homepage

You can create the container instance directly in the portal too if you prefer a more hands-on experience.
Select the container image from the Container Registry, right-click the tag and select Run Instance. Complete the relevant fields ensuring you select Windows as the OS type

Note: I tried to run the nanoserver/iis image directly from the Docker hub with the cli but the container failed to start for some reason. The same image pushed to the Azure Container Registry works fine.

Summary

If you want to have to experiment with containerising Windows applications and try them out the Azure Container Instance service is a fantastic way of quickly getting your containers up and running and testing them.
You don't need to provision any servers or install anything and you pay by the second for the usage.
Ultimately you'll probably want to run any longer lived applications on a more long term container environment, for which you are spoilt for choice - on Azure alone you have App service, Container Service or Service Fabric!