Azure Container Instances Tutorial: Run Containers Without VMs
Azure Container Instances (ACI): Simple Container Deployment Without Orchestration
Overview
Azure Container Instances (ACI) is Azure’s simplest container service, allowing you to run containers directly in the cloud without managing virtual machines or orchestration platforms. It’s ideal for scenarios requiring:
- Simplicity: No cluster management or complex configuration
- Scalability: Rapid horizontal scaling (though less sophisticated than AKS/Container Apps)
- Cost-effectiveness: Pay-per-second billing for actual compute usage
Key distinction: ACI has zero orchestration complexityโno Kubernetes, no service mesh, no ingress controllers. This makes it perfect for small applications, one-off tasks, or proof-of-concepts.
When to Choose ACI
| Scenario | Best Choice |
|---|---|
| Single container, simple workload | โ ACI |
| Multi-container microservices | Azure Container Apps or AKS |
| Auto-scaling, revisions, traffic splitting | Azure Container Apps |
| Full Kubernetes control | AKS |
| Batch jobs, scheduled tasks | ACI or Container Apps |
Deployment Walkthrough
Step 1: Create the Container Instance
Azure Portal Path: Create resource โ Search “Container Instances” โ Container Instances by Microsoft โ Create
Basic Configuration:
- Subscription: Select target subscription
- Resource group: Create new or existing
- Container name: Unique identifier
- Region: Select closest to users
- Availability zones: Optional high-availability deployment
- SKU: Standard (sufficient for most use cases)
Step 2: Container Image Source
| Option | Use Case |
|---|---|
| Quickstart images | Testing ACI functionality; pre-built Microsoft samples |
| Azure Container Registry (ACR) | Production workloads with custom images |
| Docker Hub | Public images (less common in enterprise) |
| Other registry | External private registries |
ACR Selection:
- Select registry
- Choose repository (e.g.,
staticsite) - Select tag (e.g.,
latest)
Step 3: Compute Resources
| Resource | Default | Range |
|---|---|---|
| CPU | 1 core | 0.25โ4 cores |
| Memory | 1.5 GiB | 0.5โ16 GiB |
Note: Unlike Container Apps, ACI does not auto-scale compute resources vertically. You specify fixed allocation per instance.
Step 4: Networking Configuration
| Option | Behavior | Use Case |
|---|---|---|
| Public | Accessible from internet with public IP | Web applications, public APIs |
| Private | Connected to Azure VNet; no public IP | Internal microservices, database front-ends |
| None | No network connectivity | Isolated batch processing |
Public Configuration Details:
- DNS name label: Creates
yourlabel.azurecontainer.ioFQDN - Ports: Map container ports to public access (e.g., port 80 for HTTP)
Step 5: Review and Create
Deployment completes in seconds to minutesโsignificantly faster than VM-based solutions.
Post-Deployment Management
Accessing Your Application
FQDN (Fully Qualified Domain Name):
- Format:
yourlabel.yourregion.azurecontainer.io - Located in container instance overview
- Note: Public IP can change; always use FQDN for consistent access
Key Monitoring Tabs
| Tab | Information | Troubleshooting Use |
|---|---|---|
| Overview | FQDN, public IP, state, resource group | Quick status check |
| Containers | Image source, start events, pull status | Diagnose image pull failures |
| Logs | Real-time console output | Application debugging, error tracing |
| Connect | Interactive shell (exec) | Debug running containers |
Container Events (Diagnostic Value)
The Containers tab shows the startup sequence:
- Image pull โ Success/failure status
- Container start โ Runtime initialization
- State changes โ Running, Waiting, Terminated
Common Issues:
- Image pull failures: Check ACR credentials, image name/tag, network access
- CrashLoopBackoff: Container exits immediately; check logs for application errors
- Resource constraints: OOM (Out of Memory) kills; increase memory allocation
ACI vs. Other Azure Container Services
| Feature | ACI | Container Apps | AKS |
|---|---|---|---|
| Orchestration | None | Built-in (managed K8s) | Full Kubernetes |
| Auto-scaling | Manual/restart policies | HTTP/event-based scaling | HPA/VPA/custom |
| Service discovery | None | Built-in | DNS/CoreDNS |
| Ingress | Public IP only | Custom domains, HTTPS | Full ingress control |
| Revisions | None | Built-in | Manual rollout strategies |
| Startup time | Seconds | Secondsโminutes | Minutes |
| Best for | Simple tasks, dev/test | Microservices, web apps | Complex, custom workloads |
Limitations to Consider
| Limitation | Impact | Workaround |
|---|---|---|
| No auto-scaling | Manual scale-out only | Use Container Apps for variable load |
| Single container per group | No sidecar pattern natively | Use Container Apps or AKS |
| No persistent storage | Data lost on restart | Mount Azure Files share |
| Limited networking | No load balancing, basic ingress | Front with Application Gateway |
| No GPU support | ML/AI workloads limited | Use AKS or specialized VMs |
Quick Reference: Full Deployment
# Azure CLI equivalent of portal deployment
az container create \
--resource-group myResourceGroup \
--name mycontainer \
--image myregistry.azurecr.io/staticsite:latest \
--cpu 1 \
--memory 1.5 \
--dns-name-label myapp \
--ports 80 \
--registry-login-server myregistry.azurecr.io \
--registry-username <username> \
--registry-password <password>
Key Takeaways
- Simplicity first: ACI is the fastest path from container image to running instance in Azure
- No orchestration overhead: Ideal when you don’t need scaling, service discovery, or complex networking
- Pay-per-use: Second-level billing makes it cost-effective for short-lived or sporadic workloads
- Integration point: Works well as a compute layer in larger architectures (e.g., Azure Logic Apps, Azure Functions)
ACI fills the gap between “too simple for a VM” and “too complex for serverless”โperfect for containerized tasks that just need to run.
