Introduction
Azure Container Apps is a fully managed serverless container service that enables you to run containerized applications without worrying about orchestration. In this guide, I’ll walk you through deploying your first container app.
Prerequisites
Before we begin, make sure you have:
- An active Azure subscription
- Azure CLI installed (
az --versionto check) - Docker installed locally
- Basic knowledge of containers
Creating Your First Container App
Step 1: Set Up Your Environment
First, let’s create a resource group and a Container Apps environment:
# Set variables
RESOURCE_GROUP="rg-containerapp-demo"
LOCATION="eastus"
ENVIRONMENT="env-demo"
# Create resource group
az group create \
--name $RESOURCE_GROUP \
--location $LOCATION
# Create Container Apps environment
az containerapp env create \
--name $ENVIRONMENT \
--resource-group $RESOURCE_GROUP \
--location $LOCATION
Step 2: Deploy Your Container
Now let’s deploy a simple container:
az containerapp create \
--name my-first-app \
--resource-group $RESOURCE_GROUP \
--environment $ENVIRONMENT \
--image mcr.microsoft.com/azuredocs/containerapps-helloworld:latest \
--target-port 80 \
--ingress external \
--query properties.configuration.ingress.fqdn
This command will output the FQDN where your app is accessible!
Key Features
Auto-scaling
Container Apps automatically scales based on HTTP traffic, events, or custom metrics:
scale:
minReplicas: 0
maxReplicas: 10
rules:
- name: http-scaling
http:
metadata:
concurrentRequests: "100"
Revisions
Every deployment creates a new revision, enabling:
- Zero-downtime deployments
- Traffic splitting for A/B testing
- Easy rollbacks
Best Practices
- Use managed identities instead of storing credentials
- Implement health probes for better reliability
- Set appropriate scaling rules based on your workload
- Use secrets management for sensitive configuration
Conclusion
Azure Container Apps simplifies containerized application deployment while providing enterprise-grade features like auto-scaling, traffic splitting, and managed certificates. It’s perfect for microservices, APIs, and event-driven applications.
Next Steps
- Explore Dapr integration
- Set up CI/CD with GitHub Actions
- Configure custom domains and certificates