Azure architectureIntermediate29 min read

What Does Azure Container Instances Mean?

Reviewed byJohnson Ajibi· Senior Network & Security Engineer · MSc IT Security
On This Page

Quick Definition

Azure Container Instances is a service from Microsoft Azure that lets you run a container application without having to set up or manage any virtual machines or clusters. You just define your container image and start it, and Azure handles all the infrastructure. It is perfect for simple tasks like running a script, a small web app, or a batch job that needs to run quickly and then stop. You pay only for the time the container is running.

Common Commands & Configuration

az container create --resource-group myRG --name mycontainer --image mcr.microsoft.com/azuredocs/aci-helloworld --dns-name-label aci-demo --ports 80

Creates a container instance with a public DNS name and exposes port 80. Use for simple web app deployment in ACI.

Tests ability to expose containers publicly with --dns-name-label and --ports flags. Common in AZ-104 and Azure Fundamentals.

az container create --resource-group myRG --name mycontainer --image myregistry.azurecr.io/myimage:latest --registry-login-server myregistry.azurecr.io --registry-username $(az keyvault secret show --name acr-user --vault-name myKV --query value -o tsv) --registry-password $(az keyvault secret show --name acr-pwd --vault-name myKV --query value -o tsv)

Creates a container from a private Azure Container Registry (ACR) using Key Vault for credentials. Use for secure deployments.

Tests integration of ACI with ACR and Azure Key Vault. Appears in AZ-104 and AWS SAA (similar concepts).

az container create --resource-group myRG --name mycontainer --image nginx --cpu 2 --memory 4 --environment-variables 'DB_HOST=mydbserver.database.windows.net' 'DB_NAME=mydb'

Creates a container with 2 vCPU and 4 GB memory, setting environment variables. Use for resource-constrained workloads.

Tests understanding of resource limits and environment variables. Key for exam scenarios optimizing cost/performance.

az container exec --resource-group myRG --name mycontainer --exec-command '/bin/sh'

Executes an interactive shell in a running container instance. Use for debugging or manual configuration.

Tests ability to troubleshoot running containers. Appears in AZ-104 and AWS Developer Associate (similar to docker exec).

az container logs --resource-group myRG --name mycontainer --tail 50

Displays the last 50 log lines from a container's stdout/stderr. Use for real-time monitoring or error checking.

Tests log retrieval and understanding of container monitoring. Common in exam questions about debugging.

az container create --resource-group myRG --name mycontainer --image myapp:latest --azure-file-volume-share-name myfileshare --azure-file-volume-account-name mystorageaccount --azure-file-volume-account-key $(az storage account keys list -g myRG -n mystorageaccount --query '[0].value' -o tsv) --azure-file-volume-mount-path /mnt/data

Creates a container with an Azure Files volume mounted for persistent storage. Use for stateful applications like databases.

Tests persistent storage with Azure Files, which is a key differentiator from serverless containers (e.g., AWS Fargate). Appears in AZ-104.

az container create --resource-group myRG --name mycontainer --image myapp:latest --restart-policy OnFailure --command-line 'python myapp.py --mode test'

Creates a container with restart policy OnFailure and a custom command. Use for batch jobs that should retry on failure.

Tests restart policy options (Always, Never, OnFailure) and custom commands. Key for job-oriented container scenarios.

Azure Container Instances appears directly in 49exam-style practice questions in Courseiva's question bank — one of the most-tested concepts on AZ-104. Practise them →

Must Know for Exams

Azure Container Instances appears consistently across multiple cloud certification exams, particularly those from Microsoft. For the AZ-900 (Azure Fundamentals) exam, ACI is a core example of Platform-as-a-Service (PaaS) and serverless computing. Candidates should be able to identify ACI as a serverless container service that abstracts infrastructure. Common question types include comparing ACI with Azure Virtual Machines (IaaS) and Azure App Service (PaaS). You may be asked: “Which Azure service allows you to run containers without managing servers?” The answer is ACI.

For the AZ-104 (Azure Administrator) exam, ACI is covered under the “Manage Azure compute resources” domain. Administrators need to know how to deploy and configure container groups, how to connect them to virtual networks, and how to mount Azure Files for persistent storage. Questions may present a scenario where a company wants to run a short-lived batch job that processes data from an Azure Storage blob and then terminates. The correct solution would be ACI, not AKS or VMs. Another scenario may ask about running a container with a specific CPU and memory limit. You must know the syntax for resource allocation in an ARM template or YAML file.

For the AWS target exams (AWS Cloud Practitioner, AWS Developer Associate, AWS Solutions Architect Associate), ACI is not directly part of the exam scope, but comparative questions may appear in cross-platform study materials. However, for Azure-specific exams, it is critical. The AWS equivalent would be AWS Fargate. In the Google Cloud realm, Google Cloud Run is the closest analogue. Candidates for Google ACE or Cloud Digital Leader should understand ACI as a reference point for serverless containers.

Exam questions about ACI often include distractor services. For example, “You need to run a Linux container that executes a script every hour. The script runs for 10 minutes. Which service should you use?“ Virtual Machine, AKS, and App Service are common wrong answers. The correct answer is ACI because it minimizes cost and overhead. Another pattern is networking: “You need a container that can securely access a virtual network.” The answer is ACI deployed with a VNet integration. Be aware that default ACI does not have VNet access unless explicitly configured.

on the AZ-104 and AZ-900 exams, ACI questions typically test three things: the definition (serverless container service), the use case (short-lived or batch workloads), and the configuration details (container groups, resource limits, networking modes).

Simple Meaning

Imagine you want to cook a single gourmet meal at home, but you do not want to own a stove, oven, or pots and pans. You just want to rent a small kitchen for a few hours, cook your meal, and then walk away without cleaning up. That is what Azure Container Instances does for software. Normally, running an application in the cloud requires you to set up a virtual machine, install an operating system, configure networking, and maintain it. With Azure Container Instances, you skip all of that. You give Azure a container image, which is like a pre-packaged box containing your application and everything it needs to run. Azure then starts that container on a server somewhere, runs it for as long as you need, and when it finishes, it disappears. You do not have to worry about the server, the operating system, or any of the underlying hardware.

Think of it like a food truck that parks outside your office. You order a specific dish, the chef prepares it using the truck’s built-in kitchen, you eat it, and the truck drives away. The food truck is like Azure’s infrastructure, the chef is Azure’s container runtime, the dish is your application, and the box it came in is the container image. You do not need to own a restaurant or even a kitchen to get a hot meal. Similarly, you do not need to own a server or a cluster to run your application. This makes Azure Container Instances extremely easy to use for simple tasks like running a daily report, processing a batch of data, or hosting a quick API for testing.

Another way to think about it is like a self-service laundry machine. You bring your clothes (your application) and detergent (the container image), put them in a washing machine (Azure Container Instances), pay for the cycle (compute time), and when the cycle ends, you take your clean clothes and leave. You do not care about the water pipes, the electrical wiring, or the machine’s maintenance. That is the beauty of Azure Container Instances: it abstracts away all the complexity of infrastructure. For IT learners, understanding ACI is important because it represents the simplest way to run containers in Azure, without needing to learn complex orchestration tools like Kubernetes. It is the “push-button” approach to containerization.

Full Technical Definition

Azure Container Instances (ACI) is a Platform-as-a-Service (PaaS) offering within Microsoft Azure that enables the deployment of individual containers on the Azure cloud without the need to provision or manage any underlying virtual machines, clusters, or orchestration platforms. It is a serverless container solution, meaning the user interacts only with the container-level abstraction, while Azure handles the infrastructure, including host OS patching, network configuration, and resource allocation. ACI supports both Linux and Windows containers, providing a flexible environment for a variety of workloads.

Technically, when a user sends a request to create an ACI resource, the Azure Resource Manager receives the API call and communicates with the ACI control plane. The control plane is responsible for scheduling the container on a suitable host node within an Azure datacenter. These host nodes are managed by Azure and are not directly accessible to the user. The container is isolated using Hyper-V isolation, meaning each container runs on its own lightweight virtual machine, providing strong security boundaries between containers. This is a key distinction from traditional container runtimes like Docker on bare metal, where containers share the host kernel.

ACI introduces the concept of container groups. A container group is the top-level resource and is akin to a pod in Kubernetes. A container group can contain one or more containers that share the same lifecycle, network, and storage resources. All containers within a group are scheduled on the same host machine, which allows them to communicate efficiently via localhost. Container groups are the fundamental unit of deployment in ACI. Each group is assigned a public IP address and a fully qualified domain name (FQDN) by default, which can be customized or disabled.

From a networking perspective, ACI supports both public and private connectivity. By default, each container group receives a public IP and a DNS name label. For private networking, ACI can be deployed into an Azure Virtual Network (VNet), allowing the container to communicate securely with other Azure resources like Azure SQL Database, storage accounts, or other virtual machines. This is achieved by specifying the subnet ID during deployment. ACI also integrates with Azure DNS and can use network security groups (NSGs) for traffic filtering.

Storage in ACI is primarily handled through Azure Files shares. ACI can mount an Azure Files share as a volume within the container, allowing persistent storage across container restarts. This is critical for stateful applications. ACI also supports emptyDir volumes, which are ephemeral and exist only during the container group’s lifetime, and gitRepo volumes, which clone a Git repository into the container at startup.

ACI supports a variety of container images, which can be stored in any public or private container registry, such as Docker Hub, Azure Container Registry (ACR), or any third-party registry. When using private registries, authentication is handled via image registry credentials passed in the deployment configuration. The service supports both pull-through and direct image pulls.

Resource allocation in ACI is granular. Users can specify CPU cores and memory (in GB) for each container or for the entire container group. The supported range for Linux containers is between 1 and 4 vCPUs and 1 to 16 GB of memory, while Windows containers have different limits. ACI employs a billing model based on the time the container is running and the resources allocated. This makes it cost-effective for burstable or short-lived workloads.

ACI also supports environment variables, secrets (stored as secure environment variables), and sidecar containers. Debugging is facilitated through container logs, which can be streamed via the Azure CLI or Azure Portal. The service does not support SSH access to the container host, but you can attach to the container’s console for interactive debugging if the image supports it.

From an exam perspective, it is important to understand that ACI is a “lift-and-shift” container solution, not a full orchestration platform. It lacks features like automatic scaling, load balancing, rolling updates, or self-healing. For those capabilities, Azure Kubernetes Service (AKS) is the recommended solution. ACI is best suited for simple, event-driven, or batch workloads that require minimal overhead. Key exam topics include container group vs. container, networking modes (public vs. VNet), mounting Azure Files, using ACR with ACI, and resource limits.

Real-Life Example

Imagine you are a freelance photographer who needs to edit and deliver a large batch of wedding photos to a client. You have a powerful editing computer at home, but it is tied up with other work. You need a temporary, high-performance editing workstation just for one day. You do not want to buy a second computer, nor do you want to rent an entire office with a computer for a month. What you really want is to rent a computer station by the hour in a shared workspace, use it for exactly 8 hours, then leave and never think about it again.

Azure Container Instances is exactly that rental computer station, but for software. Instead of a computer, you have a container, which is a lightweight, standalone package that contains your application code, runtime, libraries, and settings. In this analogy, the shared workspace is Azure’s data center. The desk and power outlet are the container runtime environment. The rental computer station itself is the ACI container. You bring your own software (the container image) pre-installed on a USB drive (the container registry). You plug it into the rental station, use it for the time you need, and then walk away. The workspace handles all the maintenance: cleaning the desk, ensuring the power is stable, and even providing internet access.

Now, extend this analogy to a more complex scenario. Suppose you are the photographer and you need to process 10,000 high-resolution images overnight. Instead of buying a supercomputer, you could rent 10 rental stations at the same time, each working on a different batch of photos. Each station is independent, starts when you tell it to, processes its batch, and shuts down. This is like using multiple ACI containers to run a distributed batch job. Azure Container Instances handles the parallel execution, and you only pay for the total time each station is used.

In the IT world, this maps directly to how developers use ACI for tasks like video transcoding, data processing, running CI/CD build agents, or hosting short-lived test environments. The key point is that ACI is temporary, scalable, and cost-efficient because you are not paying for idle infrastructure. Just like you would not pay monthly rent for a desk you use for a single day, you should not pay for a virtual machine that runs 24/7 if you only need it for a few hours. ACI aligns perfectly with that need.

Why This Term Matters

Azure Container Instances matters because it dramatically simplifies the way developers and IT professionals deploy containers. Before ACI, running a container in Azure typically required users to first set up a virtual machine, install Docker, and manage the container engine themselves. Alternatively, they could deploy an orchestration platform like Azure Kubernetes Service (AKS), which introduced significant complexity in terms of cluster management, networking, and configuration. ACI removes these barriers by providing a serverless, managed container runtime that abstracts away the underlying infrastructure.

For IT professionals, this means reduced operational overhead. There is no need to patch operating systems, monitor host health, or configure load balancers for simple containerized applications. ACI also accelerates development workflows. Developers can quickly spin up isolated environments to test code without waiting for infrastructure provisioning. In a DevOps context, ACI is commonly used as a task runner for continuous integration and continuous deployment (CI/CD) pipelines. For example, a build agent can run inside an ACI container to compile code, run tests, and deploy artifacts, and then the container shuts down immediately after the job finishes, minimizing costs.

In the real world, cost optimization is a major driver for adopting ACI. Traditional virtual machines incur costs even when idle. With ACI, you pay only for the seconds your container runs. This makes it ideal for batch processing, event-driven workloads, and scheduled tasks. For example, a company that needs to process customer data once a day can run an ACI container for 30 minutes and pay pennies instead of hundreds of dollars per month for a dedicated VM.

From a learning perspective, understanding ACI builds foundational knowledge for other Azure container services. It introduces core concepts like container images, registries, environment variables, and networking, which are transferable to AKS and Azure Container Apps. For exam takers, especially those targeting AZ-104 (Azure Administrator) or Azure Fundamentals (AZ-900), knowing when to use ACI versus other compute options is a recurring theme.

How It Appears in Exam Questions

Questions about Azure Container Instances on certification exams generally fall into three categories: scenario-based, configuration-based, and troubleshooting.

Scenario-based questions: These present a business requirement and ask you to select the appropriate Azure service. For example: “A company needs to run a containerized application that processes data once a day. The job should automatically scale to zero when not in use, and the company wants to minimize administrative overhead and cost.” The best answer is Azure Container Instances. Distractors might include Azure Kubernetes Service (too complex for a simple job), Azure App Service (requires a web app setup), or Azure Virtual Machines (high overhead and cost). Another scenario: “You need to run multiple containers that share a local network and a volume. Which ACI resource should you use?” Answer: Container group.

Configuration-based questions: These questions test your knowledge of deployment parameters. You might be asked to complete an ARM template snippet or a YAML file for an ACI deployment. For instance: “You need to deploy an ACI container with 2 CPU cores and 4 GB of memory. Which properties must you set?” The answer is “containerResourceLimits” or “resources.requests” and “resources.limits” depending on the schema. Another common question: “You want to mount an Azure Files share in an ACI container. What must you provide in the deployment configuration?” Answer: storage account name, share name, and storage account key. Yet another: “Which option allows an ACI container to communicate with a SQL database inside a VNet?” Answer: Deploy the container group into a specific subnet of the VNet.

Troubleshooting questions: These are less common but can appear in advanced exams like AZ-104. For example: “An ACI container fails to start. The logs show an error about missing registry credentials. What is the most likely cause?” Answer: The container image is stored in a private registry and the authentication details were not provided. Another troubleshooting pattern: “You cannot connect to an ACI container’s public IP address. What could be the issue?” Answer: The container group might be deployed in a VNet without a public IP, or the container might be exposed only on internal ports.

Multiple-choice and multi-select question types are common. For instance: “Select two scenarios where Azure Container Instances is the best choice.” Correct options: running a batch job that lasts 15 minutes, and running a simple API that handles sporadic traffic. Incorrect options: running a stateful database, hosting a production web application with high availability requirements. These scenarios help you distinguish between ACI and other services.

Practise Azure Container Instances Questions

Test your understanding with exam-style practice questions.

Practise

Example Scenario

A startup company called “PhotoQuick” runs a small web application where users can upload images and get them compressed for faster sharing. The image compression process is computationally intensive and runs only on a Linux container. The application is not used heavily most of the day, but users occasionally upload large batches, causing a sudden spike in demand. The startup wants to keep costs low and does not want to manage servers or clusters.

The solution is to use Azure Container Instances. Whenever a user uploads an image, an Azure Function is triggered. The function starts an ACI container that runs the compression tool. The container pulls the uploaded image from Azure Blob Storage, compresses it, saves the output back to Blob Storage, and then terminates. The entire process takes between 30 seconds and 5 minutes. The startup pays only for the cumulative minutes the container runs, which is a fraction of the cost of a dedicated virtual machine. If no images are uploaded, no containers run and no cost is incurred.

In this scenario, ACI is ideal because the workload is event-driven, short-lived, and can tolerate some startup latency (cold start). The startup does not need to worry about scaling because each image can trigger a separate container instance, up to the subscription limits. They also do not need to manage any infrastructure. If the startup later grows and needs orchestration, they can migrate to Azure Kubernetes Service, but for now, ACI provides the simplest path to production. This scenario is typical of what you might see on the AZ-104 exam, where you are asked to recommend the most cost-effective compute option for an intermittent batch workload.

Common Mistakes

Thinking that Azure Container Instances is a managed Kubernetes service.

ACI is not Kubernetes; it is a simple container runtime. Kubernetes is an orchestration platform managed by AKS. ACI does not provide auto-scaling, load balancing, or rolling updates.

Remember: ACI is for single-container or simple multi-container groups without orchestration. Use AKS for complex, multi-container applications that require scaling and self-healing.

Assuming ACI containers persist data by default after they stop.

ACI containers are ephemeral. When a container stops, its local file system is lost. Data does not persist unless you mount an external volume like Azure Files or use a sidecar for external storage.

Always plan for stateless application design. If you need persistence, explicitly configure an Azure Files share mount in the ACI deployment.

Believing that ACI supports unlimited CPU and memory resources.

ACI has hard resource limits. For Linux containers, the maximum is 4 vCPUs and 16 GB of memory per container group. Windows containers have different limits. Exceeding these limits will cause a deployment failure.

Check the current Azure documentation for resource quotas. For larger workloads, consider AKS or Azure Batch.

Thinking that ACI containers can always communicate with on-premises resources without configuration.

By default, ACI containers are deployed with a public IP and no VNet access. To communicate with on-premises or Azure VNet resources, you must deploy the container group into a VNet and configure appropriate network security groups.

When you need private network access, use the VNet deployment feature in ACI and ensure the subnet is properly routed.

Assuming that ACI is always the cheapest option for running any container.

For long-running, steady-state workloads, ACI can become more expensive than a reserved virtual machine instance because of per-second billing rates. ACI is cost-effective for short-lived, burstable, or event-driven workloads.

Evaluate the workload runtime. If the container runs continuously for weeks, compare the cost of an Azure VM or App Service vs. ACI.

Forgetting that ACI does not provide SSH or RDP access to the underlying host.

ACI is a PaaS service; users have no access to the host operating system. Debugging must be done via container logs, the attach feature (if the image supports it), or by running diagnostic containers.

Design containers to output logs to stdout/stderr. Use Azure Monitor and Container Insights for monitoring instead.

Exam Trap — Don't Get Fooled

{"trap":"A question asks: “You need to run a containerized application that requires 8 GB of memory and 4 CPU cores. The application runs for 8 hours every night. Which Azure service should you use?

” Candidates see “containerized” and immediately choose “Azure Container Instances.”","why_learners_choose_it":"They associate containers exclusively with ACI and think it is the default container service. They overlook the resource limits or assume ACI can handle any workload."

,"how_to_avoid_it":"Always check resource constraints. ACI’s maximum CPU is 4 vCPUs and memory is 16 GB, so 8 GB / 4 CPUs is within limits. But the bigger consideration is cost vs.

alternatives. For an 8-hour nightly job, a reserved VM might be cheaper. However, the real trap is that ACI does not natively support running on a schedule; you need an external trigger.

The best answer might be Azure Batch or AKS with a cron job, depending on requirements. Always evaluate the full scenario: duration, scheduling, and cost."

Commonly Confused With

Azure Container InstancesvsAzure Kubernetes Service (AKS)

AKS is a managed Kubernetes orchestration platform for deploying, scaling, and managing complex containerized applications across clusters of virtual machines. ACI is a simpler, serverless container runtime for individual containers or small groups. AKS supports auto-scaling, load balancing, and rolling updates, while ACI does not.

If you need to run a microservices application with 10 services that must communicate and scale independently, use AKS. If you need to run a single script that processes a file once, use ACI.

Azure Container InstancesvsAzure App Service

Azure App Service is a fully managed platform for hosting web applications, REST APIs, and mobile backends. It supports code deployment directly, not just containers. App Service can also run containers via Web App for Containers, but it is optimized for web workloads and includes built-in scaling, authentication, and CI/CD. ACI is not tied to web traffic and is better for batch or background tasks.

Hosting a company website with multiple pages and users is best on App Service. Running a nightly data cleanup script is better on ACI.

Azure Container InstancesvsAzure Batch

Azure Batch is a job scheduling and compute management service designed for large-scale parallel batch computing. It provisions and manages pools of virtual machines to run hundreds or thousands of tasks. ACI is simpler and intended for small-scale, single-container jobs. Batch offers automatic queuing, scheduling, and parallel execution across many nodes.

Rendering 10,000 frames of a 3D movie across 100 VMs is a job for Azure Batch. Running a single container to convert one video file is suitable for ACI.

Azure Container InstancesvsAzure Container Apps

Azure Container Apps is a managed serverless container platform that supports Kubernetes-style features like scaling, revisions, and ingress, but with less complexity than AKS. It is built on top of Kubernetes but abstracts much of the orchestration. ACI is lower-level, does not provide built-in scaling, and is more suitable for simple, direct container execution.

Deploying a microservice that automatically scales based on HTTP traffic is best on Container Apps. Running a one-off script triggered by a timer is best on ACI.

Azure Container InstancesvsAWS Fargate

AWS Fargate is the AWS equivalent of ACI, providing serverless compute for containers on AWS. Both are serverless, but they are different cloud platforms. Fargate works within the Amazon ECS ecosystem, while ACI is native to Azure. Functionally, they serve the same purpose: running containers without managing servers.

If you are using Azure, choose ACI. If you are using AWS, choose Fargate. They are not interchangeable in a single cloud environment.

Step-by-Step Breakdown

1

Prepare the Container Image

You start by creating a container image using a Dockerfile that contains your application code, dependencies, runtime, and settings. This image is pushed to a container registry like Azure Container Registry (ACR), Docker Hub, or any private registry. The image must be accessible to Azure during deployment.

2

Choose a Deployment Method

You decide how to deploy the ACI resource: via the Azure Portal, Azure CLI, PowerShell, ARM templates, Bicep, Terraform, or the REST API. Each method uses the same underlying resource type: Microsoft.ContainerInstance/containerGroups.

3

Define the Container Group

You create a JSON or YAML definition that specifies one or more containers in a container group. You define the image name, resource limits (CPU and memory), environment variables, ports, and volumes. The container group is the atomic unit of deployment.

4

Configure Networking

Decide on networking mode: default public IP with FQDN, or VNet integration for private networking. If VNet, you must specify the subnet ID. You can also expose ports (e.g., 80, 443) for web traffic. By default, the container group gets a public IP.

5

Mount Storage (if needed)

To persist data, you add a volume mount in the container group definition. Typically, you mount an Azure Files share by providing the storage account name, share name, and access key. EmptyDir and gitRepo volumes are other options.

6

Deploy the Container Group

You submit the deployment definition to Azure. The Azure Resource Manager processes the request, the ACI control plane schedules the container on a host node, pulls the image from the registry, and starts the container. If successful, the container begins running.

7

Monitor and Debug

You can view container logs via the Azure CLI (az container logs), stream them, or attach to the container’s console if the image supports it. Azure Monitor and Container Insights provide additional metrics like CPU and memory usage.

8

Terminate the Container

When the container finishes its work, it stops. On the Azure side, you can stop, start, or delete the container group. If the container group is not needed, it should be deleted to avoid ongoing charges. Billing stops when the container stops.

Practical Mini-Lesson

When working with Azure Container Instances in a real-world IT environment, the first thing to understand is that ACI is fundamentally a stateless, ephemeral compute service. This means you should design your applications to be stateless whenever possible. For example, if you have a container that processes a CSV file and writes the results to a database, that works perfectly. But if the container expects to write temporary files to its local filesystem and read them on the next run, that will fail because the filesystem disappears when the container stops. You must use external storage via Azure Files or another persistent store.

Professionals also need to understand the networking implications. By default, an ACI container gets a public IP. If this is not desired, you must deploy the container group into a VNet. However, VNet integration requires that the ACI service in the region supports it, and there are limitations: for example, when using VNet, the container group cannot have a public IP unless you use a NAT gateway or load balancer. This is a common gotcha in enterprise scenarios where security teams require private networking. Another nuance: ACI containers in a VNet can only communicate with resources inside that VNet if there is proper routing and NSG rules.

From a configuration standpoint, you will often use YAML files for deployment because they are easier to read and maintain than ARM templates. For example, a typical YAML for an ACI container group might look like:

apiVersion: 2021-10-01 location: eastus name: my-container-group properties: containers: - name: my-container properties: image: myregistry.azurecr.io/myapp:latest resources: requests: cpu: 1.0 memoryInGB: 2.0 ports: - port: 80 protocol: TCP imageRegistryCredentials: - server: myregistry.azurecr.io username: myuser password: mypassword restartPolicy: OnFailure osType: Linux

Notice the restartPolicy field: it can be Always, OnFailure, or Never. For batch jobs, OnFailure or Never are typical. For a web server that should run continuously, you would use Always.

What can go wrong? Common issues include: Image pull failures due to incorrect registry credentials. Always test the pull locally first. Out of memory errors if the container exceeds resource limits. Monitor the logs and adjust requests. Port conflicts if multiple containers in the same group try to use the same port. VNet deployment failures if the subnet is not delegated correctly or if there is a policy blocking deployment.

Professionals should also be aware that ACI does not support GPU instances in all regions, and GPU support is limited to specific SKUs. For machine learning inference, you might need AKS or Azure Batch instead.

In a DevOps pipeline, you can automate ACI deployments using Azure CLI commands in a CI/CD script. For example:

az container create --resource-group myRG --name mytask --image myimage --restart-policy Never --cpu 1 --memory 2 --environment-variables INPUT_FILE=myfile.csv

This allows you to pass environment variables at runtime, making ACI a flexible tool for parameterized batch jobs. The key takeaway is that ACI is a powerful tool in your toolbox, but only for the right job: short-lived, stateless, lightweight workloads. Understanding its strengths and limitations will help you avoid costly mistakes in production.

Troubleshooting Clues

Container stays in 'Pending' state indefinitely

Symptom: After creating a container, its status shows 'Pending' for more than 5 minutes without transitioning to 'Running'.

This usually occurs because the container image is large and being pulled from a registry (especially private ACR) with slow network, or the image name is incorrect. ACI has a 10-minute limit for image pull.

Exam clue: Exam questions present a scenario where a container never starts; answer often involves checking image registry credentials or network bandwidth.

Container restarts repeatedly with exit code 137

Symptom: The container logs show exit code 137 (SIGKILL), and it restarts in a loop.

This indicates the container is using more memory than the allocated limit (e.g., 2 GB). ACI terminates the container to prevent resource exhaustion.

Exam clue: Tests memory limit and OOM (Out Of Memory) scenarios. Common in AZ-104 questions about resource constraints.

DNS name not resolving for container group

Symptom: The public DNS label (e.g., aci-demo.eastus.azurecontainer.io) returns 'DNS name not found'.

The DNS name label must be globally unique within the region. If another container uses the same label, ACI fails to register it. Also, the container group may have no public IP assigned (e.g., if using '--ip-address Private').

Exam clue: Tests understanding of DNS name uniqueness and public IP assignment. Appears as a distractor in exam questions.

Environment variables not appearing in container

Symptom: Inside the container, 'echo $DB_HOST' returns empty, even though --environment-variables was specified.

If environment variables contain special characters (e.g., '--', ';') or are not properly escaped in the command, Azure CLI may misinterpret them. Also, using '--environment-variables' in PowerShell requires different quoting.

Exam clue: Tests proper CLI syntax for environment variables across different shells. Seen in exam scenarios with Azure CLI vs. PowerShell.

Container exits immediately with exit code 0

Symptom: The container runs and logs show it starts then exits quickly, no errors in logs.

This happens when the container image's entrypoint expects a long-running process (e.g., web server) but the command or entrypoint is a one-time task. ACI containers must have a process that stays alive (e.g., 'tail -f /dev/null' for testing).

Exam clue: Tests understanding that ACI requires a long-running process. Common in exam questions about container lifecycle.

Azure Files volume mount fails with 'permission denied'

Symptom: During container creation, error 'MountVolume.SetUp failed for volume... permission denied' or the container starts but cannot write to /mnt/data.

The storage account key is wrong, or the file share doesn't exist, or the container's user (e.g., root vs non-root) does not have write permissions on the Azure Files share. Also, Azure Files only supports NFS or SMB; ACI uses SMB 3.0, which requires port 445.

Exam clue: Tests Azure Files integration and persistent storage permissions. Appears in AZ-104 with troubleshooting steps.

Container group creation fails with 'OperationNotAllowed for vnet'

Symptom: When deploying a container group into a virtual network (VNet), the command fails with 'OperationNotAllowed'.

ACI VNet integration requires the subnet to be delegated to 'Microsoft.ContainerInstance/containerGroups' and have at least /28 address space. Also, the VNet must be in the same region as the container group.

Exam clue: Tests VNet delegation and subnet requirements. Key for AZ-104 networking questions.

Memory Tip

ACP: ACI = App Cooks in a Pod. ACI runs containers in a container group (Pod), and you only pay for the cooking time.

Learn This Topic Fully

This glossary page explains what Azure Container Instances means. For a complete lesson with labs and practice, see the topic guide.

Covered in These Exams

Current Exam Context

Current exam versions that test this topic — use these objectives when studying.

Related Glossary Terms

Quick Knowledge Check

1.You deploy an Azure Container Instance with 2 GB memory and a container image that requires 3 GB. What is the most likely result?

2.You need to mount persistent storage for an Azure Container Instance. Which storage service must you use?

3.A container instance stays in 'Pending' status for 8 minutes. What should you check first?

4.You want to run a batch job that retries automatically if it fails. Which restart policy should you configure?

5.You deploy a container group into a virtual network and get 'OperationNotAllowed'. What is the most likely cause?

6.You need to debug a running container instance interactively. Which command should you use?