Cloud / Azure Container Apps (ACA) Interview questions
Last updated
1. What is Azure Container Apps?
Azure Container Apps (ACA) is a fully managed, serverless container platform on Azure. You give it a container image, and it runs, scales and exposes that image for you. You never create or operate a Kubernetes cluster.
It runs on Kubernetes underneath, but that layer is hidden. You work with apps, revisions and environments instead of pods, nodes and manifests. It also bundles open-source pieces: KEDA for event-driven scaling, Dapr for microservice building blocks and Envoy for ingress.
Typical workloads are HTTP APIs, microservices, background workers, event processors and scheduled jobs. Any language works as long as it ships as a Linux container.
Take quiz
The container image itself
Your application code
The Kubernetes cluster and node management
The Azure subscription
KEDA and Dapr
Helm and Istio
Terraform and Ansible
2. What are the common use cases for Azure Container Apps?
ACA suits containerized workloads where you want Kubernetes-style scaling without running Kubernetes. The usual cases:
- Public APIs and web apps that scale with traffic.
- Microservices that call each other inside one environment, often with Dapr.
- Event-driven processors that scale on queue length or Event Hubs lag, down to zero.
- Background workers that run continuously with no ingress.
- Jobs for ETL, batch runs, migrations and scheduled tasks.
- GPU and sandboxed workloads such as model inference or running untrusted code in dynamic sessions.
It is a weaker fit when you need custom operators, CRDs, privileged containers or direct control of the cluster. AKS is the better home for those.
Take quiz
A public REST API
A queue-driven worker
A nightly batch job
One that needs custom Kubernetes operators and CRDs
A fixed replica count of 3
Event-driven scale rules powered by KEDA
Manual revision swaps
3. What is a Container Apps environment?
A Container Apps environment is the secure boundary around a group of apps and jobs. Everything inside shares a virtual network and a logging destination (usually a Log Analytics workspace), and apps can reach each other by name over internal networking.
You create the environment first and then deploy apps into it. It is also where shared settings live: workload profiles, Dapr components, Azure Files storage definitions and VNet integration.
Use separate environments when you need network isolation or different lifecycles, for example dev, test and prod.
az containerapp env create --name my-env --resource-group my-rg --location eastus
Take quiz
A virtual network and a logging destination
A single container image
One revision history
One public URL
Inside each container image
At the environment level
In the Dockerfile
Only at subscription level
4. What is a revision in Azure Container Apps?
A revision is an immutable snapshot of one version of a container app. It records the image, environment variables, CPU and memory, scale rules and the other settings in the app's template section.
A new revision is created when you change a revision-scope setting, such as the image tag or a scale rule. Application-scope changes, like ingress, secrets, registry credentials and Dapr settings, update the app without creating one.
Revision names look like myapp--v2, and you can pick the suffix with --revision-suffix. Revisions are what you roll back to or split traffic between.
Take quiz
Adding a new secret
Changing ingress IP restrictions
Updating the container image tag
No, it is an immutable snapshot
Yes, you can change its image in place
Only while it has 0% traffic
5. What is a replica in Azure Container Apps?
A replica is one running instance of a revision. It works like a Kubernetes pod: it holds your main container plus any sidecar and init containers, and they share the same network and volumes.
The platform adds and removes replicas based on your scale rules. The minimum defaults to 0, the maximum defaults to 10, and the maximum can be raised (up to 1,000 at the time of writing).
CPU and memory are set per container, but the total across a replica must fit the limits of the workload profile. Requests are load-balanced across the ready replicas of a revision.
Take quiz
1
3
0
10
Nothing, each is fully isolated
The network namespace and mounted volumes
Only the image registry
6. What are the workload profile types in Azure Container Apps?
A workload profile decides what compute your apps run on. ACA has three types: Consumption, Dedicated and Flex. Flex was still in preview when this was written, so check its status before relying on it.
| Consumption | Dedicated | Flex (preview) | |
| Billing | Per replica, by vCPU and memory used | Per node instance, plus a plan management fee | Per replica, with dedicated isolation |
| Hardware | Chosen by the platform, small replica sizes | You pick the VM family: general purpose, memory optimized or GPU | Single-tenant compute, simpler setup |
| Scale to zero | Yes | Apps can, but nodes you reserved still bill | Yes |
| Best for | Bursty or unpredictable load | Steady load, big replicas, special hardware | Isolation with consumption-style billing |
Every environment starts with a default Consumption profile, and you can add others next to it.
Take quiz
Consumption
Dedicated
Flex (preview)
Dedicated D4
Dedicated GPU
Consumption
7. What is the Consumption plan in Azure Container Apps?
The Consumption plan is the serverless default. The platform decides where replicas run, and you pay only for what they use. Apps can scale to zero, so an idle app costs nothing for compute.
A single replica can use up to 4 vCPU and 8 GiB of memory at the time of writing. Billing is by vCPU-seconds and GiB-seconds, plus a charge per million requests, with a monthly free grant per subscription.
Pick it for spiky APIs, event handlers and jobs. If you need bigger replicas, special hardware or steady high utilization, look at Dedicated profiles.
Take quiz
A workload needing 64 GiB per replica
A steady 24/7 load that needs reserved capacity
A spiky API that sits idle most of the night
By vCPU-seconds and GiB-seconds used
Per VM node hour
A flat monthly fee per app
8. What is scale to zero in Azure Container Apps?
Scale to zero means ACA drops a revision to 0 replicas when no scale rule has work to do, so the app uses no compute and has no active charges. It applies when minReplicas is 0.
When a request or event arrives, the platform starts a replica again. That first request pays a cold start: image pull (if not cached), container start and app initialization.
Only rules that can detect work while nothing is running can scale from zero: HTTP, TCP and event-driven (KEDA) rules. CPU and memory rules can't, because there is no replica to measure.
az containerapp update -n myapp -g my-rg --min-replicas 0 --max-replicas 5
Take quiz
minReplicas set to 0
maxReplicas set to 0
targetPort set to 0
Permanent loss of the app configuration
A cold start delay on the first request
A new revision is always created
9. What is the role of KEDA in Azure Container Apps?
KEDA (Kubernetes Event-driven Autoscaling) is the open-source scaler behind ACA's scale rules. You never install or run it. You describe a rule, and ACA configures KEDA for you.
A KEDA scaler watches an external source such as Service Bus, Storage queues, Event Hubs, Kafka or a cron schedule, and reports a metric. The platform turns that metric into a replica count between your min and max.
HTTP, TCP, CPU and memory rules are built in. Anything else is a custom rule, where you give the KEDA scaler type, its metadata and how to authenticate.
Take quiz
Pulls images from the registry
Issues TLS certificates
Drives replica scaling from events and metrics
Stores secrets
Enable the Dapr sidecar
Raise the CPU limit
Add a custom scale rule with a KEDA scaler type
10. What is Dapr in Azure Container Apps?
Dapr (Distributed Application Runtime) is an open-source runtime that offers microservice building blocks through a sidecar. Your app calls it over HTTP or gRPC on localhost, and ACA lets you turn it on per app.
The building blocks include service invocation, pub/sub, state management, bindings, secrets and actors. Your code calls localhost:3500 and Dapr talks to the real backing service, so you can swap Redis for Cosmos DB through configuration instead of code changes.
Enable it with an app-id and app-port, and define the components at the environment level.
az containerapp create -n orders -g my-rg --environment my-env \ --image myacr.azurecr.io/orders:1.0 \ --enable-dapr --dapr-app-id orders --dapr-app-port 8080
Take quiz
By importing the Kubernetes API
Through the Azure portal at runtime
Via a shared database table
Through the sidecar on localhost
At the environment level
Inside each Dockerfile
In the container file system only
11. What are Azure Container Apps jobs?
A Container Apps job runs a containerized task that starts, does its work and exits. It does not stay up like a service. Each run is called an execution.
Jobs have no ingress and don't serve requests. You pay only while an execution is running, which suits batch processing, ETL, database migrations, report generation and queue-draining tasks.
The settings that matter are parallelism (replicas running at once), replicaCompletionCount, replicaTimeout and replicaRetryLimit.
Take quiz
A nightly data export that finishes and exits
A public REST API with ingress
A long-running WebSocket server
A revision
An execution
A deployment slot
12. What are the trigger types for Container Apps jobs?
A job starts in one of three ways:
| Trigger | Starts when | Typical use |
| Manual | You start it from the portal, CLI or API | Database migrations, one-off fixes |
| Schedule | A cron expression fires, for example 0 2 * * * |
Nightly reports, cleanup tasks |
| Event-driven | A KEDA scaler finds work, such as messages in a queue | Processing queue messages as they arrive |
The cron expression is evaluated in UTC, so convert your local time before you set it.
Take quiz
Manual
Schedule
Event-driven
Schedule
Event-driven
Manual
HTTP
13. How do you deploy a container app using the Azure CLI?
Add the extension, register the providers once, create an environment, then create the app. The shortest working path looks like this:
az extension add --name containerapp --upgrade az provider register --namespace Microsoft.App az provider register --namespace Microsoft.OperationalInsights az containerapp env create -n my-env -g my-rg -l eastus az containerapp create -n myapp -g my-rg --environment my-env \ --image mcr.microsoft.com/k8se/quickstart:latest \ --target-port 80 --ingress external
The command prints the app's FQDN when it finishes. If you have source code and no image yet, az containerapp up --source . builds it, pushes it to a registry and deploys in one step.
Take quiz
--ingress internal
--min-replicas 1
--ingress external
--enable-dapr
az containerapp up
az containerapp env create
az containerapp revision copy
14. What is ingress in Azure Container Apps?
Ingress gives a container app an HTTPS endpoint so clients can reach it without you setting up load balancers or certificates. ACA terminates TLS and routes requests to replicas through an Envoy proxy.
You enable it and set a target port, which is the port your container listens on. Visibility is either external (reachable from outside the environment) or internal (reachable only by other apps in the same environment).
The app gets an FQDN such as myapp.<unique-id>.<region>.azurecontainerapps.io. Ingress also provides traffic splitting, IP restrictions, CORS, sticky sessions and client certificate options.
Take quiz
The public port clients must use
The port of the Log Analytics workspace
The Dapr sidecar port
The port your container listens on
It is public with no TLS
Only apps in the same environment can call it
It always requires a VPN gateway
15. What protocols does Azure Container Apps ingress support?
Ingress supports HTTP/1.1, HTTP/2 (which carries gRPC) and TCP. WebSockets work over HTTP/1.1.
The --transport setting picks the mode: auto (the default), http, http2 or tcp. With auto, ACA negotiates HTTP/1 or HTTP/2 per request.
HTTP ingress terminates TLS at the edge and forwards plain HTTP to your container. TCP ingress is for non-HTTP protocols and has extra restrictions, so check the current docs for environment requirements. UDP is not supported.
Take quiz
UDP
TCP
ICMP
tcp
http, which is HTTP/1.1 only
http2
16. What are secrets in Azure Container Apps?
Secrets hold sensitive values such as connection strings or API keys at the app level, apart from the image and the code. They are stored encrypted and referenced by name.
Containers use them in two ways: as an environment variable through secretref:, or as files in a mounted volume. Scale rules can also reference them to authenticate.
az containerapp secret set -n myapp -g my-rg --secrets db-pass=S3cret az containerapp update -n myapp -g my-rg --set-env-vars "DB_PASSWORD=secretref:db-pass"
Changing a secret is an application-scope change. It doesn't create a revision, and running replicas keep the old value until the revision restarts. For stricter control, use a Key Vault reference instead.
Take quiz
Prefix the value with $ENV:
Add it as a Dockerfile ARG
Use secretref:<name> as the value
Keep the old value until the revision restarts
Pick it up instantly
Get deleted and recreated automatically
17. How do you set environment variables in a container app?
Set them on the container in the app template, using the CLI, a YAML file, Bicep or the portal. A plain value is name=value. A secret is name=secretref:secret-name.
az containerapp update -n myapp -g my-rg \ --set-env-vars "ASPNETCORE_ENVIRONMENT=Production" "API_KEY=secretref:api-key"
Environment variables belong to the revision template, so changing one creates a new revision. Use --replace-env-vars to overwrite the full set and --remove-env-vars to delete specific ones.
ACA also injects a few variables of its own, such as CONTAINER_APP_NAME and CONTAINER_APP_REVISION.
Take quiz
A new revision is created
It is applied live with no revision
The environment is recreated
--delete-env
--remove-env-vars
--unset-env-vars
18. What are sidecar and init containers in Azure Container Apps?
Both are extra containers that run inside the same replica as your main container and share its network and volumes. The difference is when they run.
| Init container | Sidecar container | |
| When it runs | Before the app containers start, in order, then exits | Alongside the main container for the replica's whole life |
| Typical use | Seed data, wait for a dependency, fetch config | Log shippers, proxies, monitoring agents |
| If it fails | The replica doesn't start the app containers | Handled like any other container in the replica |
Dapr is a separate platform-managed sidecar. You don't define it as a container yourself.
Take quiz
Sidecar container
Init container
The Dapr sidecar
Init container
Job execution
Sidecar container
19. What is managed identity in Azure Container Apps?
A managed identity gives your app a Microsoft Entra ID identity with no credentials in code or config. It is either system-assigned (tied to the app's lifecycle) or user-assigned (a separate resource you can reuse across apps).
Common uses are pulling images from ACR, reading Key Vault secrets, and calling Storage, Service Bus or SQL with Entra authentication. Some scale rules can use it too.
In code, an SDK credential such as DefaultAzureCredential picks it up. You still have to grant the identity an RBAC role on the target resource.
az containerapp identity assign -n myapp -g my-rg --system-assigned
Take quiz
System-assigned
ACR admin user
User-assigned
An RBAC role assignment on the storage account
A new revision with a stored password
Nothing, access is automatic
20. How do you pull images from Azure Container Registry in ACA?
The recommended way is identity-based pull. Give the app a managed identity that has the AcrPull role on the registry, then point the registry setting at that identity. No admin password is involved.
az identity create -n aca-pull-id -g my-rg az role assignment create --assignee <principal-id> --role AcrPull --scope <acr-id> az containerapp create -n myapp -g my-rg --environment my-env \ --image myacr.azurecr.io/api:1.0 \ --user-assigned <identity-resource-id> \ --registry-server myacr.azurecr.io \ --registry-identity <identity-resource-id>
A user-assigned identity avoids a chicken-and-egg problem. With a system-assigned one, the app must exist before you can grant the role, but it can't start until the role exists. The fallbacks are ACR admin credentials or a username and password stored as a secret.
Take quiz
Owner
AcrPull
Key Vault Secrets User
AcrImageSigner
It is the only type ACR accepts
You can grant the role before the app exists
It removes the need for the AcrPull role
21. Describe the billing model of Azure Container Apps?
On the Consumption plan you pay for vCPU-seconds and GiB-seconds used by replicas, plus the number of HTTP requests.
Replicas bill in two states. Active replicas, which are starting or handling requests, are charged at the full rate. Idle replicas, kept alive by a minimum replica count but not busy, are charged at a lower rate. Replicas at zero cost nothing.
Each subscription gets a monthly free grant (180,000 vCPU-seconds, 360,000 GiB-seconds and 2 million requests at the time of writing, so confirm on the pricing page).
Dedicated profiles bill per node instance-hour plus a plan management fee, no matter how many apps share the node. Jobs bill only for execution time.
Take quiz
Idle replicas
Replicas scaled to zero
Replicas that are starting up
Per HTTP request
Per image pull
By node instance-hours, shared by the apps on them
22. How do you view logs for a container app?
Console output (stdout and stderr) and platform events go to the environment's logging destination, usually a Log Analytics workspace. App output lands in ContainerAppConsoleLogs_CL. Platform events such as scaling, image pulls and crashes land in ContainerAppSystemLogs_CL.
ContainerAppConsoleLogs_CL | where ContainerAppName_s == "myapp" | order by TimeGenerated desc | take 50
For quick checks, stream logs from the CLI or open Log stream in the portal. az containerapp exec opens a shell in a running replica.
az containerapp logs show -n myapp -g my-rg --follow
If you chose resource-specific tables, the names drop the _CL suffix.
Take quiz
ContainerAppConsoleLogs
AzureActivity
ContainerAppSystemLogs
az containerapp logs show --follow
az containerapp revision list
az containerapp env show
23. What is the difference between Azure Container Apps and AKS?
Both run containers on Kubernetes. The difference is how much of Kubernetes you get to touch. ACA hides it and gives you an app-level model. AKS gives you the whole cluster and the work that comes with it.
| Aspect | Azure Container Apps | AKS |
| Kubernetes API access | None, abstracted away | Full access |
| Node management | Handled by the platform | You manage node pools and upgrades |
| Autoscaling | Built-in KEDA rules, scale to zero | HPA, KEDA or cluster autoscaler that you set up |
| Customization | No CRDs, operators or privileged pods | Anything Kubernetes supports |
| Best for | APIs, microservices, workers, jobs with low ops effort | Platform teams that need control and the wider ecosystem |
Pick ACA when the team wants to ship containers, not run clusters. Pick AKS when you need operators, DaemonSets, a specific service mesh or custom networking.
Take quiz
AKS
Azure Container Apps
ACA Dedicated workload profiles
AKS with self-managed node pools
Azure Container Apps
VMs running Docker by hand
A bare Kubernetes cluster on-premises
24. What is the difference between Azure Container Apps and Azure Container Instances?
ACI runs a container group on demand with no orchestration around it. ACA is an application platform with scaling, revisions, ingress, Dapr and jobs.
| Aspect | Azure Container Apps | Azure Container Instances |
| Scaling | Rule-based autoscale, scale to zero | No built-in autoscale, one instance per group |
| Ingress | Built-in HTTPS, custom domains, traffic splitting | Public or VNet IP, you bring your own TLS |
| Revisions | Yes, with rollback and splits | No |
| Microservice features | Dapr, internal service discovery | None |
| Best for | Long-running services, event-driven apps | Short tasks, build agents, simple one-offs |
For a short job with no scaling needs, ACI works. If the task is recurring or event-driven, an ACA job is usually the neater choice.
Take quiz
Azure Container Instances
Azure Container Apps
Both equally
A multi-revision web app
A Dapr pub/sub component
ACI or an ACA job
25. When would you choose Azure Container Apps over Azure Functions?
Azure Functions gives you a trigger-and-binding programming model, and you write small functions. ACA runs whole containers, so any runtime, any web server, multiple containers per replica and long-running processes are fair game.
Choose Functions for small event-triggered code that benefits from bindings, such as a blob-triggered resize or a timer that posts a report.
Choose ACA when you need a custom runtime or a multi-container design, long-running or CPU-heavy services, Dapr, or one platform for APIs, workers and jobs together.
The two also combine. You can host Azure Functions on ACA and get KEDA-based scaling and the same environment networking.
Take quiz
A Container Apps environment
An ACA revision
Azure Functions
A custom runtime packaged as several containers
A 20-line blob-triggered resize
A timer that posts to Slack daily
26. What is the difference between Consumption and Dedicated workload profiles?
| Aspect | Consumption | Dedicated |
| Billing | Per replica, by resources used | Per node instance, shared by apps on it |
| Replica size | Small, capped by the platform | Larger, depends on the VM family you choose |
| Hardware choice | None | General purpose, memory optimized, GPU |
| Isolation | Shared infrastructure | Single-tenant nodes |
| Capacity control | None, fully automatic | You set min and max node counts |
One environment can hold both, and you attach each app to a profile with --workload-profile-name. Steady, heavy workloads often get cheaper on Dedicated, since many apps share the same paid-for node.
az containerapp env workload-profile add -n my-env -g my-rg \ --workload-profile-name d4 --workload-profile-type D4 \ --min-nodes 1 --max-nodes 3
Take quiz
Minimum and maximum node counts
The per-request price
The image pull policy
No, only one type per environment
Yes, and each app is assigned to one profile
Only in internal environments
27. What is the difference between single and multiple revision mode?
The mode decides how many revisions of an app can be active at once.
| Single revision mode | Multiple revision mode | |
| Active revisions | One | Several |
| Traffic | New revision takes 100% once it is healthy | You set the weights yourself |
| Old revision | Deactivated automatically | Stays active until you deactivate it |
| Use case | Simple, zero-downtime updates | Blue-green, canary, A/B testing |
Single is the default. In multiple mode, every active revision keeps its replicas running, so it can raise cost. Set the weights explicitly so you know where traffic is going.
az containerapp revision set-mode -n myapp -g my-rg --mode multiple
Take quiz
Multiple
Single
Labeled
Single revision mode
Job mode
Multiple revision mode
28. How does autoscaling work in Azure Container Apps?
ACA scales the replicas of each revision between minReplicas and maxReplicas, driven by scale rules. If you define none, an HTTP rule is applied by default.
Rule types: HTTP (concurrent requests per replica), TCP (concurrent connections), CPU and memory utilization, and custom KEDA scalers. The desired count is roughly the metric divided by your target, rounded up. If several rules are active, the one asking for the most replicas wins.
Event-driven rules poll every 30 seconds by default, and there is a 300-second cooldown before scaling in to zero.
flowchart LR
A["Metric source: requests, queue, CPU"] --> B["KEDA evaluates scale rules"]
B --> C{Desired count vs min and max}
C -- higher --> D["Add replicas"]
C -- lower --> E["Remove replicas after cooldown"]
C -- no work and min is 0 --> F["Scale to zero"]
Example: 50 concurrent requests with a target of 10 per replica gives 5 replicas.
Take quiz
The average of all rules
The rule that asks for the most replicas
The first rule listed
The rule with the lowest threshold
10
50
5
1
29. How do you configure an event-driven scale rule for a Service Bus queue?
Add a custom scale rule using the azure-servicebus KEDA scaler. Give it the queue name, a target message count per replica, and a way to authenticate.
az containerapp create -n worker -g my-rg --environment my-env \ --image myacr.azurecr.io/worker:1.0 \ --min-replicas 0 --max-replicas 20 \ --secrets sb-conn="<service-bus-connection-string>" \ --scale-rule-name sb-rule \ --scale-rule-type azure-servicebus \ --scale-rule-metadata queueName=orders messageCount=5 \ --scale-rule-auth connection=sb-conn
messageCount=5 means each replica is expected to handle about 5 queued messages. With 100 messages waiting, ACA aims for 20 replicas, capped by the maximum. When the queue is empty and min-replicas is 0, the app scales to zero.
Where the scaler supports it, prefer managed identity over a connection string so there is no secret to rotate.
Take quiz
The total messages the queue may hold
The maximum replica count
The target number of messages per replica
The message time-to-live
http
azure-servicebus
cpu
30. Why doesn't my container app scale to zero?
The usual reason is that something in the config keeps at least one replica alive. Check these in order:
- minReplicas is 1 or more. Confirm with
az containerapp show --query properties.template.scale. - A CPU or memory rule is configured. Those can't scale from zero and require at least one replica.
- The scale metric never drops. A queue that never empties, or WebSocket and long-lived connections that keep concurrent requests above zero.
- The cooldown hasn't passed. The default is 300 seconds after the last activity.
- The scaler is failing. Bad credentials or a wrong queue name can leave the metric stuck. Look in the system logs.
Fix the cause, and the next cooldown window should bring the replica count down to zero.
Take quiz
HTTP concurrency
Azure Service Bus queue length
Cron
CPU or memory utilization
300 seconds
30 seconds
5 seconds
1 hour
31. How does traffic splitting between revisions work in Azure Container Apps?
In multiple revision mode, ingress sends each request to a revision according to weights that must add up to 100. This is how you run canary, blue-green and A/B tests.
az containerapp ingress traffic set -n myapp -g my-rg \ --revision-weight myapp--v1=80 myapp--v2=20
The same thing in YAML:
ingress: traffic: - revisionName: myapp--v1 weight: 80 - revisionName: myapp--v2 weight: 20
Splitting is random per request, so one user may hit both versions. Turn on session affinity to keep a client on the same replica with a cookie. To roll back, set the old revision's weight to 100.
Take quiz
100
10
1
The replica count
Session affinity
Scale to zero
Init containers
32. How do you perform a blue-green deployment in Azure Container Apps?
Use multiple revision mode and revision labels. A label gives a revision its own stable URL, so you can test it before it gets any production traffic.
- Switch the app to multiple revision mode and label the current revision
blue. - Deploy the new version as a revision with a clear suffix and label it
green, with 0% traffic. - Test it on the label URL, which has the form
<app>---green.<env-domain>. - Move the weights to green once you're happy.
- Keep blue around for a quick rollback, then deactivate it.
az containerapp revision set-mode -n myapp -g my-rg --mode multiple az containerapp revision label add -n myapp -g my-rg --label blue --revision myapp--blue az containerapp update -n myapp -g my-rg --image myacr.azurecr.io/api:2.0 --revision-suffix green az containerapp revision label add -n myapp -g my-rg --label green --revision myapp--green az containerapp ingress traffic set -n myapp -g my-rg --label-weight blue=0 green=100
Take quiz
On its label-specific URL
In the Log Analytics workspace
Inside the Dockerfile
Delete the environment
Shift the traffic weight back to the old revision
Rebuild the image from scratch
33. Explain the lifecycle of a revision in Azure Container Apps?
A revision is created when you change something in the app's template, such as the image or a scale rule. From there it moves through a few stages.
flowchart LR
A["Template change"] --> B["Revision created: Provisioning"]
B --> C["Image pulled and replicas start"]
C --> D{Probes pass?}
D -- Yes --> E["Provisioned and Running"]
D -- No --> F["Failed or Degraded"]
E --> G["Receives traffic and scales"]
G --> H["Replaced by newer revision"]
H --> I[Inactive]
In single revision mode, the new revision takes all traffic only once it is healthy, and the old one is then deactivated automatically. In multiple mode you deactivate revisions yourself.
An inactive revision has no replicas and costs no compute, but it can be reactivated. ACA keeps a limited history of inactive revisions (100 by default, configurable), and the oldest are purged. You can also manage them with az containerapp revision activate, deactivate and restart.
Take quiz
Inactive
Provisioning
Traffic splitting
It still runs its minimum replicas
It is deleted the moment it is deactivated
It runs no replicas and can be reactivated
34. How does virtual network integration work in Azure Container Apps?
By default an environment uses a platform-managed network. To control it, you bring your own subnet when you create the environment. The VNet can't be swapped afterwards.
A workload profiles environment needs a subnet of at least /27, delegated to Microsoft.App/environments. The older consumption-only environment needed /23.
Once the environment is in your VNet, you can apply NSGs, route egress through a firewall or NAT gateway with user-defined routes, reach private resources like databases, and make the environment internal-only.
az containerapp env create -n my-env -g my-rg -l eastus \ --infrastructure-subnet-resource-id <subnet-id> \ --internal-only true
Take quiz
/16
/29
/12
/27
No, the VNet is chosen at creation
Yes, with one CLI flag
Yes, but only for jobs
35. What is the difference between external and internal Container Apps environments?
| Aspect | External environment | Internal environment |
| Entry point | Public IP | Private IP on an internal load balancer |
| Reachable from | The internet and your VNet | Your VNet and connected networks only |
| DNS | Azure-provided public DNS | You create a private DNS zone for the default domain |
| Typical use | Public APIs and web apps | Private line-of-business apps, often behind Application Gateway or Front Door |
Both types are built on your VNet. Note that this is separate from per-app ingress visibility. In an external environment, an app can still use internal ingress and stay hidden from the internet.
Take quiz
Internal
External
Consumption-only
A public IP per app
A private DNS zone for the default domain
A second Log Analytics workspace
36. How does service-to-service communication work inside an environment?
Apps in the same environment can call each other over internal networking. If the target app has ingress enabled, the caller can use its app name, such as http://orders, or the internal FQDN. Internal ingress keeps the target off the internet.
With Dapr enabled, you can use service invocation instead. The call goes through two sidecars, which adds retries, mTLS and tracing.
GET http://localhost:3500/v1.0/invoke/orders/method/api/orders/42
sequenceDiagram participant F as Frontend app participant FD as Dapr sidecar participant OD as Orders sidecar participant O as Orders app F->>FD: invoke orders method api/orders/42 FD->>OD: mTLS call with retries OD->>O: forward request O-->>F: response via both sidecars
Plain name-based calls are simpler. Choose Dapr when you want built-in retries and tracing without writing them yourself.
Take quiz
Use B's pod IP
Call http://app-b, as long as B has ingress enabled
Only through Azure Front Door
By editing /etc/hosts
Automatic scale to zero
Free vCPU hours
Retries, mTLS and tracing
37. How can you restrict inbound access to a container app?
Combine layers, from the app outward:
- Ingress visibility. Use internal ingress so only apps in the environment can call it.
- IP restrictions. Allow or deny specific CIDR ranges on the ingress.
- Private environment. Use an internal environment or private endpoint, and put Application Gateway or Front Door with a WAF in front.
- Authentication. Turn on built-in auth so only signed-in users reach the app.
- Client certificates. Require or accept client certs for mutual TLS.
- NSGs on the environment's subnet for network-level filtering.
az containerapp ingress access-restriction set -n myapp -g my-rg \ --rule-name office --ip-address 203.0.113.0/24 --action Allow
Take quiz
Dapr components
Scale rules
Ingress IP restrictions
Application Gateway or Front Door
Azure Container Registry
KEDA
38. Explain the execution flow of built-in authentication in Azure Container Apps?
Built-in authentication (often called Easy Auth) puts an auth layer in front of your app, so your code doesn't implement OAuth itself. It supports Microsoft Entra ID, Google, GitHub, Facebook, Apple, X and any OpenID Connect provider.
sequenceDiagram participant B as Browser participant A as Auth layer participant I as Identity provider participant P as Your app B->>A: request without session A->>B: redirect to login B->>I: sign in I->>A: token A->>A: validate and create session B->>A: request with session cookie A->>P: forward with identity headers
Your app receives the user's details in headers such as X-MS-CLIENT-PRINCIPAL and X-MS-CLIENT-PRINCIPAL-NAME.
For unauthenticated requests you pick an action: allow them, redirect to login (best for browser apps), or return 401 or 403 (best for APIs). Treat the headers as trusted only when the app can't be reached except through the auth layer.
Take quiz
X-Container-User
Authorization-App-User
X-Replica-Identity
X-MS-CLIENT-PRINCIPAL
Browser apps that should redirect to login
APIs consumed by non-browser clients
Anonymous static sites
39. How do Key Vault secret references work in Azure Container Apps?
Instead of copying a secret value into ACA, you store a reference to the Key Vault secret URI and give the app a managed identity that can read it. ACA fetches the value for the app, so the secret lives in one place.
az containerapp secret set -n myapp -g my-rg \ --secrets "db-pass=keyvaultref:https://myvault.vault.azure.net/secrets/db-pass,identityref:<identity-resource-id>"
The identity needs read access to secrets, for example the Key Vault Secrets User role. If the vault has a firewall, the app's network path must be allowed.
A reference without a version tracks the latest version, but running replicas read the value at start. After you rotate a secret, restart the revision so replicas see the new value.
Take quiz
A managed identity with read access to secrets
The Key Vault admin password
A public blob URL
The Log Analytics key
Nothing, replicas refresh every second
Delete the environment
Restart the revision so replicas read the new value
40. What happens when a health probe fails in Azure Container Apps?
ACA supports three probe types, over HTTP or TCP. Exec probes aren't supported. What happens on failure depends on the type:
| Probe | Purpose | On failure |
| Liveness | Detect a hung or deadlocked container | Container is restarted |
| Readiness | Check the app can take traffic | Replica is removed from load balancing, no restart |
| Startup | Give slow-starting apps time; other probes wait for it | Container is restarted if it never passes |
If ingress is on and you define no probes, ACA applies default TCP probes against the target port.
probes: - type: Liveness httpGet: path: /healthz port: 8080 initialDelaySeconds: 5 periodSeconds: 10 failureThreshold: 3
Take quiz
A container restart
Deletion of the revision
Removal from traffic without a restart
Startup probe
Liveness probe on its own
Readiness probe on its own
41. How do you troubleshoot a container app that keeps restarting?
Start with the system logs, since they say why a replica was restarted, then match the symptom to a cause.
az containerapp logs show -n myapp -g my-rg --type system --follow
| Symptom | Likely cause | What to check |
| Exit code 137 | Killed, often out of memory | Memory limit versus real usage |
| Restarts after about 30 seconds | Liveness probe failing | Probe path, port and thresholds |
| Starts, then 502s | Wrong target port or listening on 127.0.0.1 | Port setting and bind address |
| Crashes at boot | Missing secret, bad env var or unreachable dependency | Console logs of the previous run |
| Never starts | Image pull failure | Registry credentials and image tag |
If the cause is still unclear, run the image locally with the same environment variables, or open a shell with az containerapp exec.
Take quiz
A clean, successful shutdown
A TLS certificate error
The container was killed, often for running out of memory
A DNS misconfiguration
The billing report
The system logs
The Dapr component YAML
42. How do you troubleshoot 502 and 504 errors from Azure Container Apps ingress?
A 502 or 504 means ingress couldn't get a good answer from a replica. Common causes:
- Wrong target port. The container listens on a different port than the ingress setting.
- Listening on localhost. The app binds to
127.0.0.1instead of0.0.0.0, so the proxy can't reach it. - No ready replica. Readiness probes fail, or the app scaled from zero and is still starting.
- Request too long. Ingress times out after about 240 seconds (4 minutes). Move long work to a background job or return a status URL.
- Crash under load. Memory limits or an unhandled exception restart replicas mid-request.
Check the system logs for probe and restart events, then the console logs for the app's own errors. Compare a request through the public URL with a call from another app in the environment to see whether the problem is the ingress or the app.
Take quiz
Automatic fix by Envoy
Ingress errors, because traffic can't reach it
Faster cold starts
240 seconds
30 seconds
10 minutes
5 seconds
43. How can you reduce cold start time in Azure Container Apps?
A cold start is the delay when a replica starts from zero. It has three parts: pulling the image, starting the container and your app's own initialization.
| Technique | Effect |
Set minReplicas to 1 or more for critical APIs |
Removes cold starts for the first replica |
| Use a slim image with multi-stage builds | Faster pull and unpack |
| Keep the registry in the same region | Shorter image pull |
| Defer heavy initialization until first use | App is ready sooner |
| Tune the startup probe | Avoids premature restarts on slow boots |
| Use AOT or trimmed builds where the runtime supports it | Cuts startup CPU time |
Measure it first. The gap between the replica-created and app-listening events in the system logs shows which part dominates.
Take quiz
Set minReplicas to at least 1
Set maxReplicas to 1
Disable ingress
Lengthen log retention
They pull and unpack faster on a new replica
They bypass health probes
They remove the need for a registry
44. How can you optimize costs for Azure Container Apps?
Most savings come from not paying for idle capacity.
- Scale to zero where a cold start is acceptable. Keep minimum replicas for latency-critical apps only.
- Right-size CPU and memory from observed usage, not guesses.
- Set a sensible max replicas so a bad scale rule can't run up the bill.
- Use jobs for batch work instead of an always-on app.
- Consolidate on a Dedicated profile when many apps carry steady load, so they share nodes you already pay for.
- Watch logging cost. Log Analytics ingestion is often a big line item. Trim noisy logs and retention.
- Use the free grant for small dev and test environments.
Review the actual bill before and after each change. Check whether any commitment discounts apply to your plan type.
Take quiz
Log Analytics ingestion volume
Revision names
Ingress FQDN length
Consumption with minReplicas of 10 each
A shared Dedicated workload profile
Separate ACI groups
45. How do you configure Dapr pub/sub in Azure Container Apps?
Three pieces: turn Dapr on for each app, define the pub/sub component once on the environment, and publish or subscribe through the sidecar.
Component definition, scoped to the apps that may use it:
componentType: pubsub.azure.servicebus.topics version: v1 metadata: - name: namespaceName value: "mybus.servicebus.windows.net" - name: azureClientId value: "<identity-client-id>" scopes: - orders - inventory
az containerapp env dapr-component set -n my-env -g my-rg \ --dapr-component-name pubsub --yaml pubsub.yaml
The publisher then posts to http://localhost:3500/v1.0/publish/pubsub/orders. The subscriber exposes a /dapr/subscribe endpoint (or uses a declarative subscription) and receives messages as HTTP calls. Swapping Service Bus for another broker means changing the component file, not the app.
Take quiz
Sets the replica count
Chooses the Azure region
Limits which apps can use the component
Defines topic retention
https://dapr.azure.com/publish
http://localhost:80/send
http://localhost:3500/v1.0/publish/<pubsub>/<topic>
46. How do dynamic sessions work in Azure Container Apps?
Dynamic sessions give you fast, isolated sandboxes on demand, which is handy for running untrusted code such as LLM-generated Python. Each session runs in its own Hyper-V sandbox, separate from every other session.
You create a session pool, which keeps ready sessions warm. Your app calls the pool's management endpoint with a session identifier. The same identifier always maps to the same session, so state is kept between calls. After an idle cooldown period, the session is destroyed.
There are two session types: code interpreter (Python or Node.js, managed by the platform) and custom container (your own image).
sequenceDiagram participant App as Your app participant Pool as Session pool endpoint participant S as Isolated session App->>Pool: execute code, session id u123 Pool->>S: allocate ready session or reuse u123 S-->>App: result Note over S: idle past cooldown, session destroyed
Take quiz
A shared process
The same replica as your app
A Dapr sidecar
Its own Hyper-V sandbox
Running untrusted or LLM-generated code
Hosting a static website
Replacing Log Analytics
47. How do you implement CI/CD for Azure Container Apps?
The common pattern: build an image, push it to a registry, then update the app, which creates a new revision. GitHub Actions is the easiest route.
name: deploy on: push: branches: [main] permissions: id-token: write contents: read jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: azure/login@v2 with: client-id: ${{ secrets.AZURE_CLIENT_ID }} tenant-id: ${{ secrets.AZURE_TENANT_ID }} subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - uses: azure/container-apps-deploy-action@v2 with: appSourcePath: ${{ github.workspace }} acrName: myacr containerAppName: myapp resourceGroup: my-rg
Use OIDC federated credentials with azure/login so no long-lived secret is stored in GitHub. Set --revision-suffix to the commit SHA for easy tracing.
Azure Pipelines has an AzureContainerApps task, and az containerapp github-action add can generate a starter workflow. Keep the app definition itself in Bicep or Terraform.
Take quiz
OIDC federated credentials
The registry admin password
A shared publish profile
A new environment
A new revision
A new VNet
48. How do you mount storage volumes in Azure Container Apps?
ACA supports four volume types:
| Type | Lifetime | Notes |
| Container file system | Per container, lost on restart | Default writable layer |
| Temporary storage | Per replica, lost when the replica stops | Shared by all containers in the replica |
| Azure Files (SMB or NFS) | Persistent | Shared across replicas and apps |
| Secrets volume | Tied to the revision | Secrets exposed as files |
For Azure Files, first register the share on the environment, then reference it from the app:
az containerapp env storage set -n my-env -g my-rg \ --storage-name myfiles --azure-file-account-name mystg \ --azure-file-account-key <key> --azure-file-share-name share1 \ --access-mode ReadWrite
template: containers: - name: app volumeMounts: - volumeName: files mountPath: /data volumes: - name: files storageType: AzureFile storageName: myfiles
Take quiz
Container file system
An Azure Files volume
Temporary storage
Secrets volume
In a Dockerfile VOLUME line
In Log Analytics
On the environment, through a storage definition
49. Explain the internal working of Azure Container Apps?
ACA runs on Kubernetes clusters that Microsoft owns and operates. You never see them. You talk to the Microsoft.App resource provider, and the platform turns your app definition into workloads on those clusters.
- Control plane: stores apps, revisions and settings, and creates replicas for each revision.
- Envoy-based ingress: terminates TLS and routes requests, applying traffic weights and IP rules.
- KEDA: reads scale rules and decides how many replicas each revision needs.
- Dapr: an optional sidecar injected into replicas of apps that enable it.
- Logging and metrics agents: send console and system logs to your destination.
flowchart LR C[Client] --> E["Envoy ingress"] E --> R1["Replica 1"] E --> R2["Replica 2"] K["KEDA scaler"] -- sets replica count --> R1 M["Metrics and event sources"] --> K CP["Control plane"] -- creates revisions and replicas --> R1 R1 --> L["Logs to Log Analytics"]
The practical consequence is that you can't reach the Kubernetes API or install custom controllers. In return you skip node patching, upgrades and capacity planning.
Take quiz
The Dapr sidecar
The logging agent
The Envoy-based ingress proxy
Azure Files
Console logs
The revision list
Scale rules
The underlying Kubernetes API
50. How do you run GPU workloads in Azure Container Apps?
ACA offers two GPU options through workload profiles. GPU types and regions change, so check the current list before you plan.
- Serverless GPU (Consumption GPU profiles): NVIDIA T4 or A100 options, scale to zero, per-second billing, managed drivers.
- Dedicated GPU profiles: NC-series VMs for sustained use. This type can only be added when the environment is first created.
- Request GPU quota in your region.
- Add a GPU workload profile to the environment.
- Deploy the app and assign it to that profile.
az containerapp env workload-profile add -n my-env -g my-rg \ --workload-profile-name gpu \ --workload-profile-type Consumption-GPU-NC24-A100 az containerapp create -n infer -g my-rg --environment my-env \ --image myacr.azurecr.io/infer:1.0 \ --workload-profile-name gpu
The first request after scaling from zero is slow, because a new replica must pull a large image and load model weights. Keep one replica warm if latency matters, or mount weights from Azure Files instead of baking them into the image.