Home › Studies › AI-200 › Containers › Container Registry & App Service

Container Registry & App Service

ACR tiers · tags and cleanup · ACR Tasks · App Service containers · app settings and Key Vault references

By the tools4free.dev team · Last reviewed November 13, 2026

Practice questions for this topic →

Registry tiers and basics

TierIncluded storage (GiB)Webhooks
Basic102
Standard10010
Premium500500

The retention policy for untagged manifests is a preview feature of Premium registries.

Sign in and push images

MethodTypical useNotes
Individual Microsoft Entra identity (az acr login)Interactive push and pull by developersThe Microsoft Entra token must be renewed every 3 hours
Microsoft Entra service principalUnattended push from a CI/CD pipeline, unattended pullDefault password expiry is 1 year
Managed identity for Azure resourcesUnattended push from Azure CI/CD, unattended pull to Azure servicesRegistry permissions come from Azure RBAC role assignments
Admin user (docker login)Interactive push/pull by one developer or testerDisabled by default; full push and pull permissions; single account per registry
  1. docker tag nginx myregistry.azurecr.io/samples/nginx creates an alias with the fully qualified registry path.
  2. docker push myregistry.azurecr.io/samples/nginx pushes it.
  3. docker pull myregistry.azurecr.io/samples/nginx pulls it back.

Tags, locks and cleanup

Tag typeUse it forWhy
Stable tags (for example :1, :1.0)Base images for your container buildsThe tag keeps receiving updates, so avoid it for deployments
Unique tags (for example a build ID)Deployments, especially when scaling on multiple nodesA restart or scale-out never pulls a newer version than the other nodes
ActionCommandResult
Untagaz acr repository untagOnly the tag reference is deleted; no space is freed because the manifest and layer data remain
Delete by tagaz acr repository delete --name myregistry --image acr-helloworld:latestDeletes unique layers and any other tags associated with the image
Delete by digestaz acr repository delete --name <acrName> --image <repositoryName>@<digest>Deletes the image, its unique layers and all its tags; shared layer data is not deleted

Retention policy for untagged manifests

ACR Tasks

Task typeHow it runsNotes
Quick taskaz acr buildBuilds in Azure without a local Docker Engine and, by default, pushes the image
Run a container or multi-step taskaz acr run with a YAML fileStep types: build, push, cmd; each step uses a container as its execution environment
Source code triggerCommit (on by default), pull request (off by default)Needs a personal access token; no commit or pull-request triggers for GitHub Enterprise repos
Base image update triggerRebuilds app images when the base image is updatedAlso on by default for a timer task
Timer triggerCron expression with five fieldsSeveral timers allowed if schedules differ
Pack build (preview)az acr pack buildBuilds from source with Cloud Native Buildpacks; no Dockerfile

App Service custom containers

NeedSetting or command
Container listens on a port other than 80WEBSITES_PORT app setting. App Service allows one port for HTTP requests
Pull from a private registry with credentialsaz webapp config container set with --docker-registry-server-url, -user and -password
Pull from ACR with managed identityEnable the identity, assign AcrPull on the registry, set acrUseManagedIdentityCreds to true; for user-assigned also set acrUserManagedIdentityID
Pull from a network-protected registryVirtual network integration plus a private endpoint, then the vnetImagePullEnabled site setting
Files that survive restartsWEBSITES_ENABLE_APP_SERVICE_STORAGE; the /home directory persists when enabled
Redeploy on every pushDeployment Center, Continuous deployment On: App Service adds a webhook to the registry

App settings, connection strings and Key Vault references

Connection string typeEnvironment variable prefix
SQL ServerSQLCONNSTR_
MySQLMYSQLCONNSTR_
Azure SQLSQLAZURECONNSTR_
CustomCUSTOMCONNSTR_
PostgreSQLPOSTGRESQLCONNSTR_

CLI and PowerShell

TaskAzure CLIPowerShell
Create a Basic registryaz acr create --resource-group myResourceGroup --name mycontainerregistry008 --sku Basic-
Sign in to a registryaz acr login --name myregistry-
Get a token when no Docker daemon runsaz acr login --name <acrName> --expose-token-
Enable the admin useraz acr update -n <acrName> --admin-enabled true-
Alias an image for your registrydocker tag nginx myregistry.azurecr.io/samples/nginx-
Push an imagedocker push myregistry.azurecr.io/samples/nginx-
Build and push in Azure (quick task)az acr build --image sample/hello-world:v1 --registry mycontainerregistry008 --file Dockerfile .-
Run a YAML taskaz acr run --registry <acrName> -f build-push-hello-world.yaml https://github.com/Azure-Samples/acr-tasks.git-
Delete an image by tagaz acr repository delete --name myregistry --image acr-helloworld:latest-
Set a retention policyaz acr config retention update --registry myregistry --status enabled --days 30 --type UntaggedManifests-
Set the app portaz webapp config appsettings set --resource-group <group-name> --name <app-name> --settings WEBSITES_PORT=8000-
Grant a web app's identity pull accessaz role assignment create --assignee <principal-id> --scope <registry-resource-id> --role "AcrPull"-
Use managed identity for registry pullsaz webapp config set --resource-group <group-name> --name <app-name> --generic-configurations '{"acrUseManagedIdentityCreds": true}'-
Enable persistent storage (Linux)az webapp config appsettings set --resource-group <group-name> --name <app-name> --settings WEBSITES_ENABLE_APP_SERVICE_STORAGE=true-

Exam Tips

Tick each tip once you can answer it without looking.

“Registry name rule” → 5-50 alphanumeric characters, unique within Azure. Trap: Hyphens and underscores aren't alphanumeric.

“Image tag for deployments that scale out on many nodes” → Unique tag (for example the build ID). Trap: A stable tag keeps receiving updates, so nodes can end up on different versions.

“Image tag for base images” → Stable tags such as :1 and :1.0. Trap: :1 follows the newest 1.* image; only :1.0 stays on 1.0 updates.

“Stop a deployed image tag being overwritten or removed by mistake” → Lock it: set write-enabled to false. Trap: A retention policy only handles untagged manifests.

“Build and push an image in Azure with no local Docker Engine” → az acr build (quick task). Trap: docker build needs a local Docker Engine; az acr pack build is for source without a Dockerfile (preview).

“Rebuild app images when the base image changes” → ACR Tasks base image update trigger. Trap: A timer trigger runs on a cron schedule, not because a base image changed.

“Commit-triggered task from a Git repo” → Give the task a personal access token. Trap: GitHub Enterprise repos don't support commit or pull-request triggers. Pull-request triggers are off by default.

“Cron expression for noon UTC on weekdays” → "0 12 * * Mon-Fri". Trap: Five fields: minute, hour, day, month, day of week. The hour is the second field.

“az acr login token lifetime” → 3 hours; sign in again when it expires. Trap: Tokens aren't renewed for you; run the login command again to reauthenticate.

“az acr login in Cloud Shell, no Docker daemon” → --expose-token, then docker login with username 00000000-0000-0000-0000-000000000000. Trap: Plain az acr login needs the Docker CLI and daemon installed and running.

“Free space used by an image” → Delete by tag or digest (az acr repository delete). Trap: az acr repository untag removes only the tag; the manifest and layers stay.

“Retention policy for untagged manifests” → Premium (preview); default 7 days, range 0-365; only untagged manifests created after enabling; Docker manifests only. Trap: Don't enable it when systems pull by manifest digest; use acr purge for untagged OCI manifests.

“Custom container for App Service listens on 8080” → App setting WEBSITES_PORT=8080. Trap: App Service assumes port 80, and allows only one port for HTTP requests.

“App Service pulls from ACR with no stored credentials” → Managed identity with AcrPull plus acrUseManagedIdentityCreds true. Trap: The registry must allow ARM audience tokens. A service principal is no longer supported for Windows container pulls.

“Files in /home lost on restart of a Linux custom container” → Set WEBSITES_ENABLE_APP_SERVICE_STORAGE=true. Trap: Persistent storage is disabled by default on Linux custom containers; it is on by default on Windows.

“Secret stored as an app setting, rotated in Key Vault” → Key Vault reference @Microsoft.KeyVault(...); refetched every 24 hours, or at once after any configuration change. Trap: The identity needs the Key Vault Secrets User role (RBAC) or Get permission (access policy). An unresolved reference is passed as literal text.

“App Service connection string environment variable names” → Prefixed by type, such as MYSQLCONNSTR_ or CUSTOMCONNSTR_. Trap: .NET apps targeting PostgreSQL, Service Bus, Cosmos DB or Redis use the Custom type as a workaround.

Sources

Checked against Microsoft Learn on November 13, 2026.

← Containers overviewContainer Apps & KEDA →