In this article, I will show you “How to deploy container in Azure using the Azure Container Instances?” Probably you also want to know what is ACI (Azure Container Instances), then below would be best definition-

“The Azure Container Instances (ACI) is a service that enables a fast way to deploy containers with a per-second billing model, quick, ad-hoc, workloads without provision or manage any underlying infrastructure.”

Now let’s explore more about the configuration of Azure Container Instance using helloworld docker image.

Azure Container Instance Deployment-

1- If you already have Azure Pay-as-You-Go of Free trial account, then you need to login in Azure portal.

2- Open the Azure Cloud Shell from the Azure portal as highlighted Cloud Shell icon.

Azure shell

3- Create a new resource group with the name demo-rg  and select West US location using following commands.

az group create --name demo-rg --location westus

4- Define DNS level which expose your container to the Internet with name demo-container.


5- Now run the az container create command deploy a container instance using hello world docker image with name democontainer.

az container create \
--resource-group demo-rg \
--name democontainer \
--image microsoft/helloworld \
--ports 80 \
--dns-name-label $DNS_NAME_LABEL \
--location westus

6- Once above jobs finished, let’s run following command to check container status, run following command.

az container show \
--resource-group demo-rg \
--name democontainer \
--query "{FQDN:ipAddress.fqdn,ProvisioningState:provisioningState}" \
--out table

Now you will get your container’s FQDN name and its provisioning state as below.

FQDN Provisioning                                  State
-------------------------------------- ------------------- Succeeded

7- That’s all, you can now open a browser, hit your container’s FQDN to see it running container based helloworld app. 

8- If you want to see log file , just run the following command, which gives the logs of your container.

az container logs --resource-group demo-rg --name demo-container