Deploy containers using Azure Container Instances or Azure Container Apps

Provision and manage containers in Azure

📘Microsoft Certified: Azure Administrator Associate (AZ-104)


Containers are a way to package applications and their dependencies into a single, lightweight, portable unit. Azure provides multiple ways to run containers without managing a full virtual machine. The two main services in this exam topic are:

  1. Azure Container Instances (ACI)
  2. Azure Container Apps (ACA)

1. Azure Container Instances (ACI)

What is ACI?

  • ACI is a serverless container service. You don’t have to manage virtual machines or orchestrators like Kubernetes.
  • It is fast to deploy, ideal for single containers or simple container groups.
  • Pay only for the CPU and memory you use while your container is running.

Key Features

  • Supports Linux and Windows containers.
  • Can run one or more containers in a container group (containers in the same group share networking and storage).
  • No scaling by default; it’s meant for small or temporary workloads.
  • Integrates with Azure Virtual Networks if needed.

When to Use ACI

  • Running short-term jobs, like batch processing or scripts.
  • Running proof-of-concept or development containers quickly.
  • Integrating with other services, e.g., triggering a container from Azure Logic Apps, Azure Functions, or Event Grid.

How to Deploy A Container in ACI

  1. Using Azure Portal
    • Go to Azure Portal → Create a resource → Container Instances.
    • Specify:
      • Container image (from Docker Hub or Azure Container Registry)
      • CPU & memory size
      • OS type (Linux/Windows)
      • Networking options (public IP or VNET)
    • Click Create.
  2. Using Azure CLI az container create \ --resource-group MyResourceGroup \ --name mycontainer \ --image mcr.microsoft.com/azuredocs/aci-helloworld \ --cpu 1 --memory 1 \ --ports 80
  3. Using YAML (Optional)
    • Useful for automation and version control.
    apiVersion: 2019-12-01 location: eastus name: mycontainer properties: containers: - name: mycontainer properties: image: mcr.microsoft.com/azuredocs/aci-helloworld resources: requests: cpu: 1 memoryInGB: 1 osType: Linux ipAddress: ports: - port: 80 type: Public

2. Azure Container Apps (ACA)

What is ACA?

  • ACA is a fully managed serverless container platform designed for microservices, event-driven apps, and scaling workloads automatically.
  • ACA runs containers in the background and automatically scales based on traffic or events.

Key Features

  • Supports HTTP-based and event-driven apps.
  • Built on KEDA (Kubernetes-based Event Driven Autoscaling), so containers can scale to zero when not in use.
  • Integrates with Azure Functions, Event Grid, and Service Bus.
  • Supports multiple containers per app, revisions, and Dapr integration for microservices communication.

When to Use ACA

  • Running web APIs, microservices, or backend services.
  • Applications that need automatic scaling.
  • Event-driven workloads that respond to queues, HTTP requests, or timers.
  • Situations where you don’t want to manage Kubernetes yourself.

How to Deploy a Container in ACA

  1. Using Azure Portal
    • Go to Azure Portal → Create a resource → Container Apps.
    • Specify:
      • Container image
      • CPU & memory
      • Environment (usually a dedicated ACA environment)
      • Scaling rules (e.g., scale out based on HTTP traffic)
    • Click Review + Create.
  2. Using Azure CLI az containerapp create \ --name mycontainerapp \ --resource-group MyResourceGroup \ --environment MyEnvironment \ --image mcr.microsoft.com/azuredocs/aci-helloworld \ --target-port 80 \ --ingress 'external'
  3. Scaling Example az containerapp scale set \ --name mycontainerapp \ --resource-group MyResourceGroup \ --min-replicas 0 \ --max-replicas 5

3. ACI vs ACA – Quick Comparison

FeatureAzure Container Instances (ACI)Azure Container Apps (ACA)
TypeSingle container / container groupMicroservices / event-driven apps
ScalingManual or per-container onlyAutomatic, scale to zero supported
ManagementMinimalFully managed, can handle microservices
Use CaseQuick jobs, testing, temporary workloadsWeb apps, APIs, background tasks, microservices
NetworkingPublic IP or VNETPublic/Private ingress, can integrate with Dapr and service mesh
IntegrationLimitedIntegrates with Azure Functions, Event Grid, Service Bus, Dapr

4. Exam Tips

  • Remember ACI = single, fast, simple, pay-per-use containers.
  • Remember ACA = serverless, event-driven, scalable microservices.
  • Know CLI, Portal, and YAML deployment options.
  • Understand scenarios for using each service.
  • Know integration possibilities:
    • ACI can be triggered by Logic Apps or Azure Functions.
    • ACA can scale based on HTTP requests or events from Service Bus / Event Grid.

Summary

  • ACI is great for fast, simple container deployments, testing, or temporary jobs.
  • ACA is ideal for production apps, microservices, and event-driven workloads that need auto-scaling.
  • Both services let you avoid managing full VMs or Kubernetes clusters.
  • Understanding when to choose ACI vs ACA is key for the AZ-104 exam.

Leave a Reply

Your email address will not be published. Required fields are marked *

Buy Me a Coffee