Deploy Containerized Apps to Azure Container Apps
Intermediate15 minTrending
Deploy and scale container images on Azure Container Apps with built-in ingress, scaling rules, and revision management.
Prerequisites
- -Azure CLI installed
- -containerapp CLI extension installed
- -Container image in a registry
Steps
1
Install the Container Apps extension
Ensures the latest Container Apps CLI extension is installed.
$ az extension add --name containerapp --upgrade
2
Create a Container Apps environment
The environment is a secure boundary around a group of container apps that share networking and logging.
$ az containerapp env create --name myenv --resource-group myapp-rg --location eastus
3
Deploy a container app
Creates a publicly accessible container app with auto-scaling between 1 and 5 replicas.
$ az containerapp create --name myapi --resource-group myapp-rg --environment myenv --image mcr.microsoft.com/k8se/quickstart:latest --target-port 80 --ingress external --min-replicas 1 --max-replicas 5
Use --ingress internal for apps that should only be reachable within the environment.
4
Set scaling rules
Scales out when concurrent HTTP requests per replica exceed 50.
$ az containerapp update --name myapi --resource-group myapp-rg --scale-rule-name http-rule --scale-rule-type http --scale-rule-http-concurrency 50
5
View app logs
Streams real-time logs from the running container app.
$ az containerapp logs show --name myapi --resource-group myapp-rg --follow
Full Script
FAQ
Discussion
Loading comments...