This entry and the following ones related to container app is based on Azure Container Apps exercise found in: https://microsoftlearning.github.io/mslearn-azure-ai/instructions/azure-container-apps/01-aca-deploy-containers.html
A container app is a containerized application hosted in Azure Container Apps, a serverless platform. With this platform, you can spin up containers as apps. You need an ACR (Azure Container Registry), an image hosted in the ACR, and a Container Apps environmentm before you can create an app and run the command below.
Since the container app will pull the image from ACR, it needs to be authenticated. This is why --registry-identity system flag is used so that the app’s managed identity is used to pull images from the registry. AcrPull role is automatically assigned to the identity when this flag is used.
az containerapp create \
--name $CONTAINER_APP_NAME \
--resource-group $RESOURCE_GROUP \
--environment $ACA_ENVIRONMENT \
--image "$ACR_SERVER/$CONTAINER_IMAGE" \
--ingress external \
--target-port $TARGET_PORT \
--env-vars MODEL_NAME=$MODEL_NAME \
--registry-server "$ACR_SERVER" \
--registry-identity system
Container app created. Access your app at https://<APP_FQDN>/
{
"id": "/subscriptions/<SUBSCRIPTION_ID>/resourceGroups/<RESOURCE_GROUP>/providers/Microsoft.App/containerApps/<APP_NAME>",
"identity": {
"principalId": "<PRINCIPAL_ID>",
"tenantId": "<TENANT_ID>",
"type": "SystemAssigned"
},
"location": "<LOCATION>",
"name": "<APP_NAME>",
"properties": {
"configuration": {
"ingress": {
"external": true,
"fqdn": "<APP_FQDN>",
"targetPort": 8000
},
"registries": [
{
"identity": "system",
"server": "<ACR_NAME>.azurecr.io"
}
]
},
"template": {
"containers": [
{
"image": "<ACR_NAME>.azurecr.io/<IMAGE_NAME>:<TAG>",
"name": "<APP_NAME>"
}
]
}
},
"resourceGroup": "<RESOURCE_GROUP>",
"type": "Microsoft.App/containerApps"
}