Overview
Deploy a container to App Service from the command line when you need a repeatable workflow for scripts or CI pipelines. This approach assumes your image already exists in Azure Container Registry and App Service already has permission to pull it (often via managed identity + AcrPull, commonly granted by a platform team).
Short notes (exam revision)
- Primary command:
az webapp createwith--container-image-name - Creates the web app and sets the container image in one step
- Requires existing resource group and App Service plan in the examples
- Use full ACR image:
myregistry.azurecr.io/<image>:<tag>for deterministic deploys - Prefer an explicit tag (for example
v1) over a floatinglatestfor reproducibility
Create the web app
Azure CLI
az webapp create \
--resource-group myResourceGroup \
--plan myAppServicePlan \
--name myDocumentProcessor \
--container-image-name myregistry.azurecr.io/docprocessor:v1az webapp create creates the web app and configures the container image together. Use your ACR login server and image name, including a tag, so the deployment is deterministic.
Prerequisites to remember
| Requirement | Why it matters |
|---|---|
| Image already in ACR | CLI deploy pulls an existing tag; it does not build the image |
| Pull permission | Managed identity + AcrPull (or admin credentials) must already work |
| Plan + RG exist | Example assumes --plan and resource group are already created |
Use cases
- Paste the same create command into a release pipeline for an AI document processor API
- Redeploy a known good tag (
docprocessor:v1) without using the portal - Hand off a scripted deploy while platform owners manage identity/role assignments
Exam tips
- Key flag:
--container-image-namewith full ACR path + tag - CLI path pairs with ACR authentication options (identity/
AcrPullassumed ready) - Don’t confuse this with Container Apps YAML deploys — this is App Service
az webapp create