Create an Azure Container Instance (ACI) With Terraform

In this blog post, we will learn how to create an Azure Container Instance (ACI) group using Terraform and deploy a Docker image from Azure ACR.


In the following Terraform configuration code, I will deploy an ACI container group with a single container and use a Docker image stored in Azure Container Registry (ACR).

To access ACR, I’m using the following code which is located in line 29. If you use ACR, you will fill in the registry details as shown below. If you use a public image, remove the image code and add the path in line 37.

image_registry_credential {
    server   = ""
    username = "acrusername"
    password = "acrpassword"


To access the code, please check the configuration file below or our GitHub repository.