Containers
Container Registry · Container Instances · Container Apps · roles · restart policy · scale rules · revisions
By the tools4free.dev team · Last reviewed November 13, 2026
Practice questions for this topic →
Azure Container Registry SKUs
| Feature | Basic | Standard | Premium |
|---|---|---|---|
| Included storage | 10 GiB | 100 GiB | 500 GiB |
| Storage limit | 40 TiB | 40 TiB | 100 TiB |
| Webhooks | 2 | 10 | 500 |
| Non-Entra tokens (and scope maps) | 100 | 500 | 50,000 |
| Anonymous pull access, artifact cache rules | No | Yes | Yes |
| Repository-scoped permissions, Entra authentication, image deletion | Yes | Yes | Yes |
| Availability zones (zone redundancy) | Default, free | Default, free | Default, free |
| Geo-replication, private endpoints, public IP network rules, customer-managed keys, content trust, connected registries, dedicated data endpoints, artifact streaming, retention policy for untagged manifests, dedicated agent pools for Tasks | No | No | Yes (Premium only) |
- Zone redundancy is no longer Premium-only. It is on by default, at no extra cost, for all three SKUs in regions that support availability zones, and it can't be disabled. The
zoneRedundancyproperty may still show Disabled; that is a legacy artifact. ACR Tasks don't support availability zones. - Switching SKU causes no downtime. You can move freely between SKUs if the target SKU has enough maximum storage. Moving down from Premium disables Premium features, and you must first delete geo-replications and connected registries.
- Change SKU: portal Settings > Properties > Pricing plan, or
az acr update --name <acr> --sku Premium. - Geo-replication needs Premium. It is active-active (all replicas writable) and eventually consistent. One global endpoint
myregistry.azurecr.ioroutes clients to the replica with the best network performance. The home region is fixed at creation. - Geo-replicated storage is billed per replica (1 GiB in 5 replicas is billed as 5 GiB) but counts once against the SKU storage limit.
- Docker Content Trust (Premium only) is being removed: deprecation began Mar 31, 2025 and it is removed completely on Mar 31, 2028. The replacement is Notary Project / Notation.
Registry names, login and pushing images
- Registry name: 5 to 50 alphanumeric characters, unique in Azure. A dash isn't allowed. The name is part of the DNS name.
- The login server is the fully qualified name ending in
azurecr.io, such asmyregistry.azurecr.io. The Domain Name Label scope is chosen at creation and can't be changed. With a scope other than Unsecure, a hash is appended to the name. az acr login --nametakes only the registry name, not the login server. Use the fully qualified, all-lowercase login server withdocker tag,docker pushanddocker login.- The
az acr logintoken is valid for 3 hours. It needs the Docker CLI and daemon unless you use--expose-token. With--expose-tokenthedocker loginuser name is00000000-0000-0000-0000-000000000000and the password is the returned token. - Push order: sign in, tag the image with the login server (
docker tag nginx myregistry.azurecr.io/samples/nginx), thendocker push. The repository is created by the first push. az acr repository delete --name <acr> --image samples/nginx:latestremoves the manifest, the unique layers and all tags that point to it.
Registry authentication and roles
- Authentication methods: individual Entra identity, Entra service principal, Entra managed identity, admin user, and non-Entra repository-scoped tokens. Microsoft recommends the Entra-based ones for most scenarios.
- The admin account is disabled by default. It is one account with two regenerable passwords, always has push and pull (no RBAC), and isn't meant for multiple users. Enable it with
az acr update -n <acr> --admin-enabled true. You need it to deploy an image from the portal straight to ACI or Container Apps. - A service principal password expires after 1 year by default. Managed identity works only from Azure services that support managed identities.
- Non-Entra tokens and scope maps don't use Entra RBAC role assignments. Entra-based repository scoping uses ABAC conditions.
| Role | What it allows |
|---|---|
| AcrPull | Pull (read). No write and no control plane |
| AcrPush | Push and pull |
| AcrDelete | Delete artifacts and tags across all repositories. Doesn't delete the registry |
| AcrImageSigner | Sign images (content trust) |
| Container Registry Contributor and Data Access Configuration Administrator | Control plane: create, configure and delete registries, change SKU, admin account, geo-replication, networking. Lets az acr login work. No data-plane push or pull, no role assignments, no ACR Tasks |
| Container Registry Tasks Contributor | Manage ACR Tasks, az acr build and az acr run |
| Container Registry Data Importer and Data Reader | Use az acr import |
| Container Registry Repository Reader / Writer / Contributor | Data-plane roles in "RBAC Registry + ABAC Repository Permissions" mode; support optional ABAC conditions to scope to repositories |
- AcrPull, AcrPush and AcrDelete are the roles Learn lists for the RBAC Registry Permissions mode. In the RBAC Registry + ABAC Repository Permissions mode, Learn lists the Container Registry Repository Reader, Writer and Contributor roles instead. The mode is shown under Settings > Properties.
- To make role assignments on a registry you need Owner or Role Based Access Control Administrator on it.
- Give a service principal or identity pull rights:
az role assignment create --assignee <principalId> --scope <registry-id> --role acrpull.
ACR Tasks
- ACR Tasks run cloud-based image builds (Linux, Windows, ARM): quick tasks, tasks triggered by source commit, pull request, base image update or a timer, and multi-step tasks.
az acr build --registry <acr> --image <repo>:<tag> <context>sends the build context to ACR and by default pushes the image to the registry. No local Docker engine is needed.- The default build platform is Linux/AMD64; use
--platformfor Windows or other architectures. The commit trigger is on by default; the pull request trigger isn't. A source-update trigger needs a personal access token.
Azure Container Instances (ACI)
| Setting | Detail |
|---|---|
| What it is | Linux or Windows containers without managing VMs, billed per second. Images from Docker Hub, ACR or other registries |
| Images | x64 (AMD64) only; ARM64 isn't supported. Image size up to 15 GB |
| Container group | Containers on the same host sharing lifecycle, resources, local network and volumes (like a Kubernetes pod). Containers reach each other through localhost |
| Multi-container groups | Linux only. Windows supports a single container per group. Deploy with a YAML file or an ARM template |
| Restart policy | Always (default); OnFailure restarts only on a nonzero exit code and runs at least once; Never isn't restarted on exit code 0. Stopped Never and OnFailure containers show Terminated |
| Scaling | Size is set by CPU and memory requests at deployment; changing CPU or memory means deleting and re-creating the group |
| Group size | Group allocation = sum of container requests. A container's limit must be at least its request. Minimum group allocation is 1 CPU and 1 GB |
| Hard limits | 60 containers, 20 volumes and 5 ports per IP per group |
| Volumes | Azure Files, emptyDir, gitRepo and secret volumes are Linux only. Azure Files mounts need Linux, root, SMB, and the storage account name, share name and key |
| Secrets in environment variables | Use secureValue instead of value. The value isn't shown by az container show or the portal |
- Updating: re-run
az container createwith the same name and at least one changed updatable property. All containers in the group restart, and unspecified properties revert to defaults. Terminated or deleted groups can't be updated. - Changing OS type, CPU or memory, restart policy, network profile or availability zone requires deleting the group and creating it again.
- Public access: an IP address and FQDN. With a DNS name label the app is at
<label>.<region>.azurecontainer.io, and the label must be unique within the region. The group's IP can change on restart. - VNet: the subnet must be delegated to ACI and can hold only container groups. The group gets a private IP address. A NAT gateway is the only supported outbound configuration. Use a /24 or larger subnet. Network profiles are retired as of API version 2021-07-01.
- Pull from ACR with a managed identity: only a user-assigned identity works (system-assigned isn't supported for ACR pulls). Grant it
acrpull, thenaz container create ... --acr-identity $USERID --assign-identity $USERID. If the ACR has a private endpoint, put the endpoint on a different subnet from the one delegated to ACI. - Run-once job: deploy with
--restart-policy OnFailure(or Never). When the process exits the state becomes Terminated and billing stops. Read output withaz container logs. - Resize a group: delete it and re-create it with new
--cpuand--memory.
Azure Container Apps
| Topic | Detail |
|---|---|
| What it is | Serverless platform for containerized apps. Scales on HTTP traffic, events, CPU or memory, or any KEDA scaler. Most apps can scale to zero, but apps scaling on CPU or memory can't |
| Environment | Secure boundary around apps and jobs that share a virtual network and a Log Analytics destination. Workload profiles environment (default; Consumption and Dedicated plans) or Consumption-only (legacy). Idle or failed environments older than 90 days are deleted automatically |
| Revision | Immutable snapshot. Single mode (default) swaps with zero downtime. Multiple mode keeps several active revisions and allows traffic splitting |
| New revision | Created by changes in properties.template: containers and images, scale rules, revision suffix |
| No new revision | Application-scope changes in properties.configuration: secrets, revision mode, ingress, traffic splitting, labels, registry credentials, Dapr |
| Ingress | External or internal, HTTP or TCP, with no load balancer or public IP resources to create. HTTP request timeout is 240 seconds. External TCP ingress needs an environment with a custom virtual network |
| Internal-only environment | --internal-only true can't be changed after creation |
| Containers | linux/amd64 images only, from any public or private registry. No privileged containers. Sidecar and init containers are supported |
| Consumption CPU and memory | Fixed pairs from 0.25 vCPU / 0.5 Gi up to 4.0 vCPU / 8.0 Gi (memory = 2 x vCPU). A Consumption-only environment caps at 2 cores and 4 Gi |
Container Apps scaling
| Item | Detail |
|---|---|
| Replicas per revision | Minimum default 0, maximum default 10, configurable up to 1,000. With no rule defined, the default is an HTTP rule, 0 to 10 replicas |
| HTTP rule | concurrentRequests, default 10 per replica |
| TCP rule | concurrentConnections, default 10 per replica |
| Custom rule | Any KEDA scaler, including CPU, memory, Service Bus, Event Hubs, Kafka and Redis |
| Multiple rules | Scaling begins when any rule's condition is met |
| Zero replicas | No usage charge. Set minimum replicas to 1 or more to keep an instance running |
| Vertical scaling | Not supported. Replica count only; CPU and memory per replica are revision template settings |
| Editing scale rules | Creates a new revision. The portal doesn't offer TCP rules or managed-identity auth for scalers; use the CLI, ARM or Bicep |
If ingress is disabled and you set no minimum replicas and no custom rule, the app scales to zero and can never start again.
- Secrets are application-scoped. Adding, changing or removing a secret doesn't create a revision, and existing revisions must be restarted (or a new revision deployed) to pick up the change. Env vars reference secrets with
secretref:<name>. - Key Vault references need the identity to have Key Vault Secrets User. A system-assigned identity can't be used in the same
az containerapp createthat references Key Vault, because it doesn't exist until the app does; create the app first or use a user-assigned identity. - Pull from ACR with managed identity: enable the identity on the app, grant it
acrpullon the registry, and configure the registry withidentity(the resource ID for user-assigned,systemfor system-assigned) and no user name or password. Microsoft prefers a user-assigned identity. - Docker Hub pull limits can make containers fail to start; ACR avoids this.
- Register the
Microsoft.Appresource provider before using Container Apps.
CLI and PowerShell
| Task | Azure CLI | PowerShell |
|---|---|---|
| Create registry (Premium) | az acr create -n myregistry -g myrg -l <region> --sku Premium | |
| Change SKU | az acr update --name myContainerRegistry --sku Premium | Update-AzContainerRegistry -ResourceGroupName myResourceGroup -Name myContainerRegistry -Sku Premium |
| Sign in to registry | az acr login --name <registry> | Connect-AzContainerRegistry -Name <registry> |
| Enable admin user | az acr update -n <registry> --admin-enabled true | Update-AzContainerRegistry -Name <registry> -ResourceGroupName <rg> -EnableAdminUser |
| Cloud build | az acr build --registry <acr> --image <repo>:<tag> <context> | |
| Add geo-replica | az acr replication create --registry <acr> --location <region> | |
| Grant AcrPull | az role assignment create --assignee $SPID --scope <registry-id> --role acrpull | New-AzRoleAssignment -ObjectId $PrincipalId -Scope $RegistryId -RoleDefinitionName acrpull |
| ACI with restart policy | az container create -g myRG --name mycontainer --image <img> --restart-policy OnFailure | New-AzContainerGroup -ResourceGroupName myRG -Name mycontainer -Image <img> -RestartPolicy OnFailure |
| ACI DNS label and port | az container create ... --dns-name-label aci-demo --ports 80 | |
| ACI pull via managed identity | az container create ... --acr-identity $USERID --assign-identity $USERID | |
| ACI logs, shell, export | az container logs, az container exec --exec-command "/bin/sh", az container export | Get-AzContainerInstanceLog -ResourceGroupName myRG -ContainerGroupName name |
| Container Apps extension and provider | az extension add --name containerapp --upgrade; az provider register --namespace Microsoft.App | Install-Module -Name Az.App; Register-AzResourceProvider -ProviderNamespace Microsoft.App |
| Create environment | az containerapp env create --name <env> --resource-group <rg> --location <loc> | New-AzContainerAppManagedEnv @EnvArgs |
| Create app with ingress and scale | az containerapp create -n app -g rg --image <img> --environment env --ingress external --target-port 80 --min-replicas 1 --max-replicas 5 --scale-rule-name my-http-rule --scale-rule-http-concurrency 50 | New-AzContainerApp @AppArgs |
| Secrets and env var reference | --secrets "queue-connection-string=<value>" and --env-vars "ConnectionString=secretref:queue-connection-string" | New-AzContainerAppSecretObject -Name n -Value v |
Exam Tips
Tick each tip once you can answer it without looking.
“Cheapest ACR SKU that supports private endpoints, geo-replication or customer-managed keys” → Premium. Trap: Standard. Over Basic it adds storage, throughput, anonymous pull access and cache rules, not these features.
“Enable zone redundancy on a Standard registry in a region with availability zones” → Nothing to do: it is on by default for all SKUs and can't be disabled. Trap: upgrading to Premium. That was the older rule.
“One image name and one set of credentials, replicated to two regions” → Premium with geo-replication (az acr replication create). Trap: separate registries per region. Geo-replication uses a single login server.
“Name a new registry my-registry-01” → Invalid: 5 to 50 alphanumeric characters, unique, no dash. Trap: assuming hyphens are allowed like in some other resource names.
“Push an image to ACR: which commands, in which order” → az acr login --name <registry>, docker tag with the login server, docker push. Trap: passing the full login server to az acr login --name. It takes the registry name only.
“Build an image in Azure without Docker installed” → az acr build (an ACR Tasks quick task); it also pushes to the registry. Trap: docker build on a VM.
“A pipeline's service principal must only pull images” → AcrPull at the registry scope. Trap: AcrPush, which also pushes. The Container Registry Contributor and Data Access Configuration Administrator role is control plane and can't pull or push.
“A user must delete old images but not the registry” → AcrDelete. Trap: a control-plane role. Container Registry Contributor and Data Access Configuration Administrator can delete registries.
“Deploy from ACR to ACI without stored credentials” → User-assigned managed identity with acrpull; use --acr-identity and --assign-identity. Trap: a system-assigned identity. ACI doesn't support it for ACR pulls.
“One-off batch job in ACI that stops when it finishes” → Restart policy OnFailure or Never. Trap: the default Always, which restarts the container.
“Change CPU, memory or restart policy of an existing container group” → Delete and re-create the group. Trap: re-running az container create with new values. These properties can't be updated in place.
“Two containers in one ACI group: a web server and a logging sidecar” → Multi-container group (Linux only), deployed with YAML or ARM; they talk over localhost. Trap: Windows. A Windows group holds a single container.
“Mount an Azure Files share in ACI” → Linux containers only; you need the account name, share name and key. Trap: a Windows container. Azure Files mounts are Linux only.
“Hide a database password from az container show” → secureValue in the environment variable (or a secret volume). Trap: a plain value, which is visible.
“ACI must reach a database over a private IP” → Deploy into a VNet in a delegated subnet; use a NAT gateway for outbound. Trap: giving it a public IP address. A group deployed into a virtual network gets a private IP address.
“Container app: scale to zero when idle, up to 20 replicas on HTTP load” → Min replicas 0, max replicas 20, HTTP scale rule. Trap: a CPU or memory rule, which can't scale to zero, or leaving the default maximum of 10.
“Container app triggered by queue messages” → Custom KEDA scale rule (for example Service Bus). Trap: an HTTP rule. It counts concurrent requests only.
“Send 20% of traffic to a new container app revision” → Multiple revision mode with traffic splitting. Trap: Single mode, which replaces the old revision once the new one is ready.
“Change a container app secret” → No new revision; restart existing revisions (or deploy a new one) to pick it up. Trap: expecting running revisions to update. Secrets are application-scoped.
“Container app pulls from ACR with a managed identity” → Enable the identity, grant acrpull, set the registry identity (no user name or password). Trap: admin credentials, or AcrPush.
Sources
- Azure Container Registry SKU features and limits
- ACR authentication options
- Quickstart: create a registry in the portal
- ACR Entra permissions and role assignments overview
- Geo-replication in ACR
- Zone redundancy in ACR
- ACR Tasks overview
- Push and pull images with Docker CLI
- Transition from Docker Content Trust to Notary Project
- Serverless containers in Azure (ACI overview)
- Introduction to container groups
- Restart policy for run-once tasks
- Resource availability and quota limits for ACI
- Mount an Azure Files volume to a container group
- Set environment variables in a container instance
- Update a container group
- Deploy a container group to an Azure virtual network
- ACI image pull from ACR using a managed identity
- Azure Container Apps overview
- Scaling in Azure Container Apps
- Update and deploy changes (revisions) in Azure Container Apps
- Containers in Azure Container Apps
- Ingress in Azure Container Apps
- Container Apps environments
- Manage secrets in Container Apps
- Container Apps image pull from ACR with managed identity
- az containerapp reference
Checked against Microsoft Learn on November 13, 2026.