Tag: Azure Container Apps

Monitor and troubleshoot solutions on AKS and Container Apps by inspecting logs, events, and end-to-end connectivity (AI-200 Exam Prep)

This post is a part of the AI-200: Developing AI Cloud Solutions on Azure  Exam Prep Hub.
This topic falls under these sections:
Develop containerized solutions on Azure (20–25%)
   --> Implement container-orchestrated solutions
      --> Monitor and troubleshoot solutions on AKS and Container Apps by inspecting logs, events, and end-to-end connectivity


Note that there are 10 practice questions (with answers) at the end of each section to help you solidify your knowledge of the material. Also, there are 4 practice tests with 30 questions each available from the hub's main page below the exam topics section.

Overview

Modern AI applications frequently run as distributed containerized solutions. A typical application might include several containers, APIs, background workers, databases, messaging services, and external Azure services. When something goes wrong, determining where the problem exists is often more difficult than identifying that a problem exists.

For the AI-200 exam, developers should understand how to troubleshoot applications running on:

  • Azure Kubernetes Service (AKS)
  • Azure Container Apps
  • The networking and services that connect application components
  • Azure monitoring and logging capabilities

A particularly important skill is knowing how to work from the application outward:

Application/container → Pod or replica → Service/ingress → Network → Destination

This approach helps isolate whether a problem is caused by the application itself, the container runtime, Kubernetes configuration, service discovery, ingress, networking, or an external dependency.


1. The Troubleshooting Mindset

When an application is failing, avoid immediately changing configuration. First determine which layer is failing.

A useful troubleshooting sequence is:

  1. Is the application running?
  2. Is the container healthy?
  3. Are there useful application logs?
  4. Are there Kubernetes or platform events indicating a problem?
  5. Can the application communicate with its immediate dependency?
  6. Can the service route traffic to the application?
  7. Can traffic enter or leave the application environment?
  8. Is the external dependency itself healthy?

For AKS, Microsoft recommends an inside-out approach for connectivity problems: begin with the pod and application, then work outward through the service and networking layers toward the client or destination.

This approach is particularly useful on the exam because a scenario may provide several symptoms but only one layer is actually responsible for the failure.


2. Logs vs. Events vs. Metrics

One of the most important distinctions to understand is the difference between logs, events, and metrics.

SignalWhat it tells youTypical use
LogsWhat the application or platform reportedApplication errors, exceptions, startup failures
EventsWhat happened to an infrastructure/resource objectScheduling failures, image pulls, restarts
MetricsNumerical measurements over timeCPU, memory, request rate, latency
TracesHow a request traveled through distributed componentsEnd-to-end request troubleshooting

Logs

Logs are particularly useful when the application itself knows why it failed.

Examples include:

  • Database connection failures
  • Authentication errors
  • Exceptions
  • Invalid configuration
  • Failed API calls
  • Application startup errors

Events

Events are especially useful when Kubernetes or the hosting platform is having difficulty creating, scheduling, starting, or managing a workload.

Examples include:

  • Failed scheduling
  • Failed image pulls
  • Container creation failures
  • Probe failures
  • Pod restarts
  • Resource constraints

Metrics

Metrics help identify patterns rather than individual failures.

Examples include:

  • CPU utilization
  • Memory utilization
  • Request rate
  • Replica count
  • Network traffic
  • Latency
  • Restart counts

A common exam scenario is:

An application is slow and occasionally unavailable.

Logs may identify the immediate application error, while metrics may reveal that CPU or memory is saturated and events may reveal that pods are being restarted.

You often need all three signals to understand the complete problem.


3. Monitoring and Troubleshooting AKS

AKS provides Kubernetes-native troubleshooting capabilities together with Azure monitoring services.

Important tools include:

  • kubectl get
  • kubectl describe
  • kubectl logs
  • kubectl exec
  • kubectl get events
  • Azure Monitor
  • Container insights
  • Azure portal
  • Application logs
  • Kubernetes events
  • Metrics

4. Start by Checking Pod Status

The first question is simple:

Is the workload actually running?

Use:

kubectl get pods

For a specific namespace:

kubectl get pods -n <namespace>

To see pods across all namespaces:

kubectl get pods -A

You might see states such as:

  • Running
  • Pending
  • Succeeded
  • Failed
  • CrashLoopBackOff
  • ImagePullBackOff
  • ErrImagePull
  • ContainerCreating
  • Terminating

These statuses provide an initial indication of where to investigate.

Example

Suppose you see:

NAME READY STATUS RESTARTS
ai-worker-7f4b8c9d8-x2k4m 0/1 CrashLoopBackOff 8

The pod is repeatedly starting and failing.

The next step should generally be to investigate the pod rather than immediately examining the network.


5. Use kubectl describe to Examine Resource Details and Events

Use:

kubectl describe pod <pod-name>

Or:

kubectl describe pod <pod-name> -n <namespace>

kubectl describe provides detailed information about the Kubernetes object, including its configuration, status, conditions, and associated events.

This is particularly useful for identifying problems such as:

  • Failed scheduling
  • Image pull failures
  • Insufficient resources
  • Failed health probes
  • Volume mount problems
  • Container startup problems

For example, an event such as:

Failed to pull image

points toward an image or registry problem rather than an application networking problem.

Likewise:

FailedScheduling

suggests that Kubernetes cannot place the pod on an appropriate node.


6. Kubernetes Events

Kubernetes events record significant activities involving Kubernetes resources.

Examples include:

  • Pod scheduling
  • Container creation
  • Container startup
  • Image pulling
  • Failed scheduling
  • Probe failures
  • Resource-related problems

You can list events with:

kubectl get events

For a namespace:

kubectl get events -n <namespace>

Events can also be sorted or filtered when investigating a particular problem.

Kubernetes events are extremely useful for troubleshooting, but they are not intended to be a permanent application log store. By default, Kubernetes events have limited retention; current Azure documentation notes that events are available for approximately one hour unless longer-term collection is configured through monitoring capabilities such as Container insights.

Exam Tip

If a question asks:

“Which tool should you use to determine why a pod failed to start?”

Think:

kubectl describe pod and Kubernetes events

If the question asks:

“What did the application itself report?”

Think:

container logs


7. Inspect Container Logs in AKS

Use:

kubectl logs <pod-name>

For a specific namespace:

kubectl logs <pod-name> -n <namespace>

For a particular container in a multi-container pod:

kubectl logs <pod-name> -c <container-name>

This is especially useful when:

  • The application starts and then crashes
  • The application throws an exception
  • A dependency cannot be reached
  • Configuration is invalid
  • Authentication fails
  • The application is returning errors

8. Inspect Logs from a Previous Container Instance

This is an important troubleshooting technique.

If a container has crashed and restarted, its current log may not contain the information from the previous instance.

Use:

kubectl logs <pod-name> --previous

For a particular container:

kubectl logs <pod-name> -c <container-name> --previous

This is particularly valuable when diagnosing:

  • CrashLoopBackOff
  • Startup failures
  • Unexpected application termination
  • Configuration errors during initialization

Exam Scenario

A pod repeatedly restarts. The current container appears healthy, but you need to determine why the previous instance terminated.

The appropriate command is:

kubectl logs <pod-name> --previous

9. Kubernetes Health Probes

Health probes are another major source of troubleshooting information.

Kubernetes supports:

Liveness probe

Determines whether a container is still functioning.

If the liveness probe repeatedly fails, Kubernetes can restart the container.

Readiness probe

Determines whether the application is ready to receive traffic.

A container can be running but not ready.

Startup probe

Provides additional time for applications that require significant startup time before liveness/readiness checks should begin.


Why Probes Matter

Consider an AI inference service that requires 60 seconds to load a model.

If its liveness probe begins failing after only 10 seconds, Kubernetes may repeatedly restart the container before the model finishes loading.

The result can be:

CrashLoopBackOff

even though the application itself is not fundamentally broken.

Therefore, when investigating repeated restarts, inspect:

kubectl describe pod <pod-name>

and look for probe-related events.


10. Inspect AKS Services

A pod’s IP address is generally not the endpoint that clients should depend on.

Kubernetes Services provide stable networking for workloads.

List services:

kubectl get svc

Describe a service:

kubectl describe svc <service-name>

You should investigate:

  • Service type
  • Port
  • Target port
  • Selector
  • Cluster IP
  • Endpoints
  • Associated pods

A common failure is a Service selector that does not match the labels on the intended pods.

For example, a Service might select:

selector:
app: ai-api

while the pods actually have:

labels:
app: ai-service

The pods may be healthy, but the Service has no appropriate endpoints.


11. Check Service Endpoints

One of the most important connectivity checks is determining whether a Service actually has endpoints.

For example:

kubectl get endpoints <service-name>

Depending on the Kubernetes version and configuration, EndpointSlices can also be examined:

kubectl get endpointslices

If the Service has no usable endpoints, traffic cannot be routed to the expected application pods.

This creates an important troubleshooting distinction:

Pod is healthy ≠ Service is correctly routing traffic


12. Test Connectivity from Inside the Cluster

When troubleshooting network connectivity, testing from inside the cluster can eliminate several variables.

For example, you can run a temporary diagnostic pod and test connectivity to another service.

Useful tools can include:

nslookup <service-name>
curl http://<service-name>:<port>

or:

nc -z -v <host> <port>

The exact tools available depend on the container image.

This allows you to determine whether:

  • DNS resolution works
  • The destination port is reachable
  • The service responds
  • The application is actually listening

13. End-to-End AKS Connectivity Troubleshooting

Consider this architecture:

Internet
|
v
Ingress / Load Balancer
|
v
Kubernetes Service
|
v
Pod
|
v
Application
|
v
External Azure Service

A useful troubleshooting process is to work through the architecture one layer at a time.

Step 1: Is the pod running?

kubectl get pods

Step 2: Is the application healthy?

kubectl logs <pod-name>

Step 3: Are there Kubernetes events?

kubectl describe pod <pod-name>

Step 4: Does the Service exist?

kubectl get svc

Step 5: Does the Service have endpoints?

kubectl get endpoints <service-name>

Step 6: Can another pod reach the Service?

Use a test container and:

curl http://<service-name>:<port>

Step 7: Does DNS work?

For example:

nslookup <service-name>

Step 8: Does external ingress work?

Test the externally exposed endpoint.

Step 9: Can the application reach external dependencies?

Test the required destination from inside the workload.

This approach prevents you from assuming that every connectivity problem is an ingress problem.


14. Container Insights for AKS

Azure Monitor Container insights provides monitoring capabilities for AKS.

It can provide visibility into:

  • Container logs
  • Kubernetes events
  • Pod metrics
  • Cluster information
  • Resource utilization

The Live Data capability can provide direct access to AKS container logs, events, and pod metrics for real-time troubleshooting.

This can be particularly useful when you want Azure-based monitoring rather than relying exclusively on command-line Kubernetes tools.

Important distinction

kubectl logs is a Kubernetes-native method for retrieving container logs.

Container insights provides an Azure monitoring experience that can aggregate and visualize Kubernetes telemetry.


15. Azure Container Apps Monitoring

Azure Container Apps abstracts much of the underlying Kubernetes infrastructure.

Unlike AKS, you generally do not troubleshoot Container Apps by directly managing Kubernetes nodes and pods.

Instead, use Container Apps’ platform-level monitoring capabilities.

Important sources include:

  • Container console logs
  • System logs
  • HTTP logs
  • Log streams
  • Azure Monitor
  • Application Insights
  • Metrics
  • Diagnose and solve problems

16. Container App Console Logs

Container console logs originate from the application’s:

  • stdout
  • stderr

These are useful for diagnosing application-level problems.

For example:

Database connection failed

or:

Authentication failed

or:

Unhandled exception

These messages can help identify problems inside the application.

Azure Container Apps allows console logs to be viewed through the Azure portal and CLI.


17. Container Apps System Logs

System logs are generated by the Container Apps service rather than directly by the application.

They can help identify platform-level problems such as:

  • Revision provisioning failures
  • Container startup issues
  • Configuration problems
  • Volume mounting failures
  • Dapr component issues
  • Application configuration changes
  • Other service-level events

This creates an important exam distinction:

ProblemMost useful source
Application exceptionConsole logs
Revision provisioning failureSystem logs
Container lifecycle issueSystem/platform logs
HTTP request behaviorHTTP logs
Resource utilizationMetrics

18. Viewing Container Apps Log Streams

In the Azure portal, navigate to the Container App and select:

Monitoring → Log stream

You can select between:

  • Console
  • System

The console stream displays application/container output, while the system stream provides platform-level information.

You can also use the Azure CLI.

For example:

az containerapp logs show \
--name <CONTAINER_APP_NAME> \
--resource-group <RESOURCE_GROUP> \
--type console

For system logs:

az containerapp logs show \
--name <CONTAINER_APP_NAME> \
--resource-group <RESOURCE_GROUP> \
--type system

You can use --tail to limit the number of messages and --follow to continuously stream logs.


19. Container Apps Revisions and Replicas

Container Apps uses revisions and replicas.

This matters when troubleshooting because the application may have:

  • Multiple revisions
  • Multiple replicas
  • Multiple containers

A log problem might exist only in one revision or replica.

Therefore, when investigating Container Apps logs, determine:

  1. Which revision is receiving traffic?
  2. Which replica is experiencing the problem?
  3. Which container is producing the error?
  4. Is the problem isolated or occurring across all replicas?

This is particularly important during deployments.

For example:

Revision A → healthy
Revision B → failing

If traffic has been shifted to Revision B, users may experience failures even though Revision A remains healthy.


20. Container Apps and Scaling to Zero

Container Apps can scale an application down to zero replicas depending on its scaling configuration.

This creates a potential troubleshooting trap.

If an application is scaled to zero, there may be no active replica from which to stream console logs.

If the log stream indicates that the revision is scaled to zero, you may need to temporarily configure a minimum replica count greater than zero to investigate the running application.

Exam Tip

If a Container App has no active replicas:

Don’t assume the application has crashed.

It may simply have scaled to zero.


21. Container Apps HTTP Logs

Container Apps can also provide HTTP-related telemetry through its ingress layer when diagnostic settings are configured.

These logs can help investigate:

  • HTTP status codes
  • Request behavior
  • Client requests
  • Ingress problems
  • Application availability

This is useful when the container itself appears healthy but clients are receiving errors.

For example:

Client → Container Apps ingress → Container

If the container logs show no corresponding request, investigate the ingress/routing layer.


22. Diagnose and Solve Problems in Container Apps

Azure Container Apps provides a Diagnose and solve problems experience for investigating application health, configuration, and performance.

This can be useful when problems are not immediately obvious from application logs.

For example, Container Apps diagnostics can help investigate container exit events and provide information about possible causes and resolutions.


23. AKS vs. Container Apps Troubleshooting

Understanding the difference between AKS and Container Apps is important for AI-200.

AreaAKSAzure Container Apps
Kubernetes API accessYesAbstracted from developer
kubectl troubleshootingYesGenerally not the primary approach
Pod troubleshootingYesPlatform abstracts replicas
Kubernetes eventsDirectly availablePlatform-level diagnostics/logs
Container logskubectl logsLog stream / CLI
System logsKubernetes/Azure monitoringContainer Apps system logs
Service configurationKubernetes ServicesContainer Apps ingress
ScalingKubernetes autoscaling mechanismsContainer Apps scaling rules
Node troubleshootingPossibleManaged/abstracted
Azure MonitorYesYes
Container InsightsAvailableNot the primary troubleshooting interface

Key Exam Principle

If a question emphasizes:

Pods, nodes, Services, Deployments, Kubernetes events, kubectl

think:

AKS

If it emphasizes:

Revisions, replicas, Container Apps log streams, system logs, console logs, ingress

think:

Azure Container Apps


24. Troubleshooting Common AKS Problems

Problem: Pod is Pending

Check:

kubectl describe pod <pod-name>

Look for events such as:

FailedScheduling

Potential causes include:

  • Insufficient CPU
  • Insufficient memory
  • Node constraints
  • Affinity rules
  • Taints and tolerations
  • Resource quotas

Problem: ImagePullBackOff

Check:

kubectl describe pod <pod-name>

Potential causes include:

  • Incorrect image name
  • Incorrect image tag
  • Private registry authentication
  • Network connectivity to the registry
  • Image does not exist

Problem: CrashLoopBackOff

Check:

kubectl logs <pod-name>

Then:

kubectl logs <pod-name> --previous

And:

kubectl describe pod <pod-name>

Potential causes include:

  • Application crash
  • Invalid configuration
  • Missing secret
  • Failed dependency connection
  • Failed liveness probe
  • Incorrect startup behavior

Problem: Pod is Running but Requests Fail

Investigate:

  1. Application logs
  2. Pod readiness
  3. Service configuration
  4. Service endpoints
  5. DNS
  6. Network policies
  7. Ingress/load balancer
  8. External networking

A Running status does not guarantee that an application is reachable.


25. Troubleshooting Common Container Apps Problems

Problem: Container exits

Check:

  • Console logs
  • System logs
  • Container exit events
  • Revision status
  • Application startup configuration

A zero exit code can indicate normal termination, while a nonzero exit code generally indicates failure. Container Apps provides diagnostic information about container exit events.


Problem: Application is unavailable

Check:

  1. Active revision
  2. Replica count
  3. Ingress configuration
  4. Console logs
  5. System logs
  6. HTTP logs
  7. Health probes
  8. Application dependencies

Problem: New deployment fails

Check:

  • Revision provisioning
  • Container image
  • Environment variables
  • Secrets
  • Managed identity
  • Registry access
  • Container startup
  • Application logs

A new revision can fail while a previous revision continues to operate.


26. Troubleshooting End-to-End Connectivity

End-to-end connectivity problems require a broader perspective.

Consider an AI application with this architecture:

User
|
v
Azure Front Door / Application Gateway
|
v
Container App or AKS Ingress
|
v
Application
|
+------> Azure OpenAI
|
+------> Azure Cosmos DB
|
+------> Azure Service Bus
|
+------> Azure Storage

A failure could occur anywhere along this path.

The correct troubleshooting approach is to identify the first point at which communication fails.


27. Test from the Same Network Context

A common troubleshooting mistake is testing connectivity from your laptop when the actual application runs inside Azure.

For example:

Laptop → Azure service

may work while:

Container → Azure service

fails.

The application should therefore be tested from the same network context in which it runs.

For AKS, this may mean executing commands from a diagnostic pod.

For Container Apps, troubleshooting may involve application logs, platform diagnostics, ingress configuration, and network configuration.


28. DNS Troubleshooting

DNS problems can make a healthy application appear unavailable.

Suppose an application attempts:

https://my-database.example.com

but cannot resolve the hostname.

The application may produce errors such as:

Name or service not known

or:

DNS resolution failed

In AKS, test DNS from inside the cluster:

nslookup <hostname>

or:

nslookup <service-name>

If DNS resolution fails, investigate DNS configuration before investigating the application itself.


29. Port and Protocol Troubleshooting

A common problem is confusing:

  • Container port
  • Service port
  • Target port
  • External port

For example:

Client
|
| TCP 443
v
Ingress
|
| TCP 8080
v
Service
|
| TCP 8080
v
Pod

The application must actually be listening on the expected port.

A connectivity test such as:

nc -z -v <host> <port>

can help determine whether a TCP port is reachable.


30. Application Connectivity vs. Infrastructure Connectivity

Another important distinction is:

Can the network connection be established?

versus:

Does the application successfully process the request?

For example:

TCP connection succeeds
|
v
HTTP 500

The network is functioning, but the application has an error.

Conversely:

Connection timeout

may indicate a networking, routing, firewall, DNS, or service availability problem.

The HTTP response code and application logs should therefore be considered together.


31. A Practical AKS Troubleshooting Playbook

When an AKS application is unavailable, use this sequence.

Step 1 — Check pods

kubectl get pods -A

Step 2 — Inspect unhealthy pods

kubectl describe pod <pod-name>

Step 3 — Read logs

kubectl logs <pod-name>

Step 4 — Check previous container logs

kubectl logs <pod-name> --previous

Step 5 — Check events

kubectl get events

Step 6 — Check Services

kubectl get svc

Step 7 — Check endpoints

kubectl get endpoints <service-name>

Step 8 — Test DNS

nslookup <service-name>

Step 9 — Test connectivity

curl http://<service-name>:<port>

Step 10 — Investigate ingress and external networking

Only after the internal application path is confirmed should you move farther outward.


32. A Practical Container Apps Troubleshooting Playbook

For Azure Container Apps:

Step 1 — Check revision status

Determine whether the expected revision is active and healthy.

Step 2 — Check replica state

Determine whether the application has active replicas or has scaled to zero.

Step 3 — Inspect console logs

Look for application-level errors.

Step 4 — Inspect system logs

Look for platform and revision-level problems.

Step 5 — Inspect HTTP/ingress telemetry

Determine whether requests are reaching the application.

Step 6 — Check configuration

Review:

  • Environment variables
  • Secrets
  • Managed identity
  • Registry configuration
  • Ingress
  • Health probes

Step 7 — Check external dependencies

Determine whether the application can communicate with required Azure services.

Step 8 — Use Azure diagnostics

Use the Container Apps diagnostic capabilities when the source of the problem remains unclear.


33. Common Troubleshooting Mistakes

Mistake 1: Assuming Running Means Healthy

A pod can be Running while the application inside it is broken.

Use readiness status, logs, and probes.


Mistake 2: Looking Only at Application Logs

Infrastructure events may reveal the actual problem.

For example:

ImagePullBackOff

is unlikely to be explained by an application log because the application may never have started.


Mistake 3: Looking Only at Events

Events can tell you that something happened, but application logs may explain why the application itself failed.

Use both.


Mistake 4: Troubleshooting Ingress First

If the pod isn’t running, spending time troubleshooting ingress is premature.

Work from the application outward.


Mistake 5: Ignoring Previous Container Logs

A restarted container may have lost the most useful evidence.

Use:

kubectl logs --previous

Mistake 6: Assuming a Container App with No Logs Is Broken

The application might be scaled to zero.

Check its replica/scaling state.


Mistake 7: Testing from the Wrong Location

A connection that succeeds from your development machine does not prove that it will succeed from the Azure-hosted application.

Test from the application’s network context whenever possible.


34. Exam-Focused Command Reference

TaskCommand
List podskubectl get pods
List all podskubectl get pods -A
Describe podkubectl describe pod <pod>
View container logskubectl logs <pod>
View previous container logskubectl logs <pod> --previous
View a specific containerkubectl logs <pod> -c <container>
List eventskubectl get events
List serviceskubectl get svc
Describe servicekubectl describe svc <service>
View endpointskubectl get endpoints <service>
Test HTTP connectivitycurl <url>
Test DNSnslookup <hostname>
Test TCP connectivitync -z -v <host> <port>
Container Apps console logsaz containerapp logs show --type console
Container Apps system logsaz containerapp logs show --type system
Follow Container Apps logsaz containerapp logs show --follow

35. Key Concepts to Remember for AI-200

The following distinctions are particularly important for exam preparation.

AKS

kubectl get

Use it to see the current state of Kubernetes resources.

kubectl describe

Use it to investigate resource configuration, status, conditions, and events.

kubectl logs

Use it to inspect application/container output.

kubectl logs --previous

Use it to inspect logs from a previous container instance.

kubectl get events

Use it to investigate Kubernetes lifecycle and scheduling events.

Services and endpoints

Use them to determine whether traffic can be routed from a Kubernetes Service to the intended pods.

Container insights

Use Azure Monitor capabilities for broader monitoring, logs, events, and metrics.


Azure Container Apps

Console logs

Application/container output.

System logs

Container Apps platform/service events.

HTTP logs

Ingress-level HTTP activity when configured.

Log stream

Near-real-time access to console and system logs.

Revisions

Different deployed versions of an application.

Replicas

Running instances of a revision.

Diagnose and solve problems

Azure’s diagnostic capabilities for investigating application health and platform problems.


36. Final Exam Strategy

When presented with a troubleshooting scenario, identify the symptom first.

If the question mentions:

CrashLoopBackOff

Think:

  • kubectl logs
  • kubectl logs --previous
  • kubectl describe pod
  • Health probes

ImagePullBackOff

Think:

  • Image name/tag
  • Container registry
  • Authentication
  • kubectl describe pod

FailedScheduling

Think:

  • Node resources
  • Scheduling constraints
  • Taints/tolerations
  • kubectl describe pod

Pod is Running but service is unreachable

Think:

  • Service
  • Selector
  • Endpoints
  • DNS
  • Ports
  • Network policies
  • Ingress

Container Apps application error

Think:

  • Console logs

Container Apps platform/revision problem

Think:

  • System logs
  • Revision status

Container App has no active replica

Think:

  • Scaling to zero

Requests reach the application but return HTTP errors

Think:

  • Application logs
  • HTTP logs
  • Dependency failures

Application cannot reach an Azure service

Think:

  • DNS
  • Network routing
  • Firewall/network restrictions
  • Identity/authentication
  • Service availability
  • Test from the application’s network context

The most important principle is:

Don’t troubleshoot the entire system at once. Start at the failing workload and move outward until you find the first broken connection or component.


Practice Exam Questions

Question 1

An application running on AKS repeatedly enters the CrashLoopBackOff state. The development team wants to determine what happened immediately before the most recent container restart.

Which command should you use?

A. kubectl get svc <pod-name>

B. kubectl logs <pod-name> --previous

C. kubectl get events --all-namespaces

D. kubectl top nodes

Answer: B

Explanation:
kubectl logs --previous retrieves logs from the previous instance of a container. This is particularly useful when a container has crashed and restarted. kubectl get events can provide additional context, but it does not provide the application’s actual log output from the previous container instance.


Question 2

An AKS pod remains in the Pending state. You need to determine why Kubernetes has not scheduled the pod onto a node.

Which action should you take first?

A. Run kubectl logs on the pod.

B. Restart the deployment.

C. Run kubectl describe pod and inspect the Events section.

D. Check the application’s HTTP logs.

Answer: C

Explanation:
kubectl describe pod provides detailed information about the pod and its associated events. Scheduling failures such as insufficient resources, taints, affinity constraints, or other scheduling problems are commonly reported there. A pod that has not started generally will not have useful application logs.


Question 3

An AKS application is running successfully in its pod. However, requests sent through a Kubernetes Service do not reach the application.

Which investigation is most appropriate next?

A. Check whether the Service has endpoints corresponding to the application pods.

B. Restart the AKS cluster.

C. Examine only the application’s CPU utilization.

D. Delete and recreate the container image.

Answer: A

Explanation:
A healthy pod does not guarantee that a Service is routing traffic to it. Checking the Service and its endpoints helps determine whether the Service selector matches the intended pods and whether usable endpoints have been registered.


Question 4

An Azure Container Apps application is returning errors. The developer wants to see messages written by the application’s container to stdout and stderr.

Which log source should be inspected?

A. Container Apps system logs

B. Azure Activity Log

C. Kubernetes events

D. Container Apps console logs

Answer: D

Explanation:
Container Apps console logs contain output from the application’s containers, including stdout and stderr. System logs instead contain information generated by the Container Apps service.


Question 5

An Azure Container Apps application was working yesterday but now appears to have no running instances. No application errors are visible in the console log stream.

What should you investigate first?

A. Whether the container image has been deleted.

B. Whether the application has scaled to zero replicas.

C. Whether Kubernetes nodes are running.

D. Whether the AKS API server is reachable.

Answer: B

Explanation:
Container Apps can scale applications to zero replicas depending on the configured scaling rules. When no replicas are running, there may be no active container instance producing console logs. AKS node and API-server troubleshooting is not appropriate because Container Apps abstracts the underlying Kubernetes infrastructure.


Question 6

An AKS application is accessible from one pod but cannot resolve the DNS name of another Kubernetes Service.

Which troubleshooting technique is most appropriate?

A. Increase the pod’s CPU limit.

B. Restart every node in the cluster.

C. Run a DNS lookup such as nslookup from the application’s network context.

D. Rebuild the container image.

Answer: C

Explanation:
If the problem appears to be DNS resolution, testing DNS from inside the cluster helps determine whether the workload can resolve the target name. Testing from the same network context as the application is important because DNS behavior can differ between environments.


Question 7

A new revision of an Azure Container Apps application fails during deployment, while the previous revision continues to operate correctly.

Which information is most useful for determining whether the new revision encountered a platform-level provisioning problem?

A. The system logs for the Container App

B. The developer’s local application logs

C. The user’s browser cache

D. The CPU utilization of an unrelated Azure VM

Answer: A

Explanation:
Container Apps system logs contain platform-level information, including revision provisioning and service-level events. They are therefore appropriate when investigating deployment or revision provisioning failures.


Question 8

An AKS application is running, but clients receive connection timeouts. The development team wants to troubleshoot the problem using an inside-out approach.

Which sequence is most appropriate?

A. Check the external client, then immediately restart the cluster.

B. Check the Azure subscription, then rebuild the application.

C. Check the ingress first and ignore the pods.

D. Check the pod/application, then Service and endpoints, then networking and external access.

Answer: D

Explanation:
An inside-out approach begins with the workload itself and progressively moves outward. First verify that the pod and application are healthy, then verify Service routing and endpoints, and finally investigate ingress and external networking. This approach helps identify the first layer where connectivity fails.


Question 9

An AKS application container is repeatedly restarted. The application logs show no obvious error, but kubectl describe pod reports repeated liveness probe failures.

What is the most likely area to investigate?

A. The Azure subscription’s billing configuration.

B. The container’s liveness probe configuration and application startup/health behavior.

C. The user’s browser DNS cache.

D. The container registry’s image retention policy.

Answer: B

Explanation:
Repeated liveness probe failures can cause Kubernetes to restart a container. The probe’s path, port, timing, timeout, and failure thresholds should be evaluated against the application’s actual startup and health behavior.


Question 10

An AI application running in AKS can connect to an external Azure service from a developer workstation but receives connection timeouts when running inside the cluster.

Which approach provides the most useful next diagnostic step?

A. Assume the external service is unavailable.

B. Increase the application’s memory allocation.

C. Test DNS and network connectivity to the destination from inside the AKS network context.

D. Delete the application deployment and recreate it.

Answer: C

Explanation:
Successful connectivity from a developer workstation does not prove that connectivity from AKS is working. Testing DNS resolution and network connectivity from inside the cluster helps isolate problems involving routing, firewall rules, network policies, private endpoints, DNS, or other network-specific configuration.


Summary

For AI-200, monitoring and troubleshooting containerized applications is fundamentally about understanding where the failure occurs.

For AKS, become comfortable with:

  • kubectl get
  • kubectl describe
  • kubectl logs
  • kubectl logs --previous
  • kubectl get events
  • Services
  • Endpoints
  • DNS testing
  • Connectivity testing
  • Health probes
  • Azure Monitor and Container insights

For Azure Container Apps, understand:

  • Console logs
  • System logs
  • HTTP logs
  • Log streams
  • Revisions
  • Replicas
  • Scaling to zero
  • Ingress
  • Container exit events
  • Azure diagnostics

Most importantly, develop an inside-out troubleshooting methodology:

Container → application → pod/replica → Service/ingress → network → external dependency

When you can identify the first layer where communication or execution breaks, you can usually identify the correct troubleshooting tool and the most appropriate remediation.


Go to the AI-200 Exam Prep Hub main page

Implement event-driven scaling by using Kubernetes Event‑driven Autoscaling (KEDA) in Container Apps (AI-200 Exam Prep)

This post is a part of the AI-200: Developing AI Cloud Solutions on Azure  Exam Prep Hub.
This topic falls under these sections:
Develop containerized solutions on Azure (20–25%)
   --> Implement container-orchestrated solutions
      --> Implement event-driven scaling by using Kubernetes Event‑driven Autoscaling (KEDA) in Container Apps


Note that there are 10 practice questions (with answers) at the end of each section to help you solidify your knowledge of the material. Also, there are 4 practice tests with 30 questions each available from the hub's main page below the exam topics section.

Overview

Modern AI applications frequently perform work asynchronously. Instead of processing every request synchronously, an application might place work onto a queue or event stream and have one or more containerized workers process those events.

This architecture creates an important scaling question:

How can the application automatically add or remove container instances based on the amount of work waiting to be processed?

Kubernetes Event-driven Autoscaling (KEDA) provides the answer.

Azure Container Apps uses KEDA to support event-driven autoscaling. A container app can use KEDA-based scaling rules to respond to events and metrics from supported sources such as Azure Service Bus, Azure Event Hubs, Apache Kafka, and Redis. Container Apps manages the KEDA integration for you, so you don’t install or operate KEDA yourself.

For the AI-200 exam, the important skill is understanding when to use KEDA, how KEDA determines replica counts, how scaling rules are configured, and how authentication and scale limits affect the resulting application behavior.


1. What Is KEDA?

Kubernetes Event-driven Autoscaling (KEDA) is an autoscaling component designed to scale containerized workloads based on events or external metrics.

Traditional autoscaling commonly uses resource metrics such as:

  • CPU utilization
  • Memory utilization

Those metrics can be useful, but they don’t always represent the actual workload.

Consider an AI document-processing application:

                ┌──────────────────┐
Documents ────► │  Service Bus     │
                │      Queue       │
                └────────┬─────────┘
                         │
                         │ Pending messages
                         ▼
                ┌──────────────────┐
                │ KEDA scaler      │
                └────────┬─────────┘
                         │
                  Scale decision
                         │
              ┌──────────┴──────────┐
              ▼                     ▼
        Container App         Container App
          Replica 1             Replica 2

If there are only a few messages, the application may need only one replica.

If thousands of messages are waiting, additional replicas can be created to process the workload concurrently.

This is event-driven autoscaling.


2. KEDA in Azure Container Apps

Azure Container Apps incorporates KEDA into its scaling architecture.

This is an important exam distinction:

You don’t deploy and manage a separate KEDA installation for an Azure Container App.

Instead, you configure a scale rule on the container app. Azure Container Apps uses KEDA behind the scenes to evaluate the rule and determine how many replicas are needed.

Conceptually:

External event source
KEDA scaler
Scale rule evaluation
Desired replica count
Azure Container Apps
├── Replica 1
├── Replica 2
├── Replica 3
└── ...

This makes KEDA particularly useful for background workers and asynchronous AI workloads.


3. Why Event-Driven Scaling Is Important for AI Applications

AI workloads frequently have unpredictable demand.

For example, imagine a document-processing application:

  1. Users upload documents.
  2. Documents are placed into an Azure Service Bus queue.
  3. Containerized workers retrieve documents.
  4. Workers send documents to an AI service.
  5. Results are stored in a database.

During periods of low activity, perhaps only one worker is necessary.

During a large batch upload, hundreds or thousands of documents might be waiting.

A fixed number of replicas creates two problems:

Too few replicas

1 worker
├── Document 1
├── Document 2
├── Document 3
├── ...
└── Document 10,000

Processing becomes slow.

Too many replicas

20 workers
└── Almost nothing to process

Resources are unnecessarily consumed.

KEDA allows the application to dynamically respond to the workload.


4. KEDA Versus CPU-Based Autoscaling

A common exam scenario is determining whether resource-based scaling or event-based scaling is more appropriate.

Suppose a worker application consumes messages from Azure Service Bus.

CPU usage might look like this:

Queue MessagesCPU Usage
05%
10015%
1,00020%
10,00025%

CPU isn’t necessarily a good representation of the amount of work waiting.

KEDA can instead monitor the queue itself.

For example:

Target = 20 messages per replica
20 messages → 1 replica
40 messages → 2 replicas
100 messages → 5 replicas
200 messages → 10 replicas

This makes the scaling decision directly related to the workload.


5. KEDA Scalers

A KEDA scaler connects KEDA to an external event source or metric.

Azure Container Apps supports KEDA-based custom scaling rules for various event sources.

Common examples include:

  • Azure Service Bus
  • Azure Event Hubs
  • Apache Kafka
  • Redis
  • Azure Queue Storage
  • Other supported KEDA scalers through custom rules

Azure Container Apps also supports HTTP and TCP scaling rules, but these aren’t the same thing as event-driven KEDA scaling.

For the exam, remember:

HTTP scaling and event-driven scaling are different scaling mechanisms.


6. Container Apps Scale Rules

Scaling is configured through the container app’s scale configuration.

A scale configuration contains concepts such as:

  • minReplicas
  • maxReplicas
  • rules
  • polling interval
  • cooldown period

A simplified conceptual configuration looks like this:

scale:
minReplicas: 0
maxReplicas: 10
rules:
- name: service-bus-rule
type: azure-servicebus
metadata:
queueName: orders
messageCount: 20

The exact metadata depends on the KEDA scaler being used.

The important exam concept is the relationship:

Scale Rule
├── Scaler type
├── Metadata
└── Authentication
KEDA
Desired replicas

7. minReplicas

minReplicas specifies the minimum number of replicas that the application can maintain.

For example:

minReplicas = 1

means that the application won’t scale below one replica.

This is useful when:

  • The application must always be available.
  • Cold-start latency is undesirable.
  • The workload can’t tolerate scaling to zero.

By contrast:

minReplicas = 0

allows the application to scale down to zero when there is no workload.

Azure Container Apps supports a minimum of zero replicas and a maximum configurable replica count of up to 1,000.


8. maxReplicas

maxReplicas establishes the upper limit on scaling.

For example:

minReplicas: 0
maxReplicas: 20

means:

0 ≤ replicas ≤ 20

Even if the event source contains a massive backlog, the application won’t exceed the configured maximum.

This is important for:

  • Controlling costs
  • Protecting downstream services
  • Preventing excessive concurrency
  • Preventing an application from overwhelming a database or AI service

Exam tip

If a question asks:

“How can you prevent an event-driven application from creating an excessive number of replicas?”

Look for:

Configure maxReplicas.


9. Target Values and Scaling

Many KEDA scalers use a target value that represents the desired workload per replica.

For example, consider:

messageCount = 20

Conceptually, this means the scaler targets approximately 20 messages per replica.

If there are 100 messages:

Desired replicas = ceil(100 / 20)
Desired replicas = 5

Therefore:

100 messages
Target = 20 messages/replica
5 replicas

Azure Container Apps describes the general scaling calculation as:

desiredReplicas =
ceil(currentMetricValue / targetMetricValue)

subject to the configured scaling limits and Container Apps’ scaling behavior.


10. Example: Azure Service Bus

Suppose an AI application processes image-analysis requests from an Azure Service Bus queue.

The scaling rule specifies:

messageCount = 10
minReplicas = 0
maxReplicas = 10

The approximate relationship is:

MessagesDesired Replicas
00
1–101
11–202
21–303
51–606
91–10010
50010

The final example is limited by maxReplicas.

Therefore, even if 500 messages are waiting, the application won’t create 50 replicas when the maximum is 10.


11. Polling Interval

KEDA periodically checks the event source.

Azure Container Apps uses a default KEDA polling interval of 30 seconds for custom scale rules.

Conceptually:

T0
├── KEDA checks queue
T+30 sec
├── KEDA checks queue
T+60 sec
├── KEDA checks queue
...

This is important because event-driven scaling isn’t necessarily instantaneous.

If a question describes a workload that suddenly receives messages and asks why scaling doesn’t happen immediately, the polling interval may be relevant.


12. Cooldown Period

The cooldown period determines how long KEDA waits before scaling an application from its final active replica down to zero after the event source becomes inactive.

The default cooldown period for Container Apps custom scaling is 300 seconds.

For example:

Messages arrive
Scale out
Messages processed
Queue becomes empty
Cooldown period
Scale to zero

An important distinction is that the cooldown period specifically affects scaling from the final replica to zero; it isn’t simply a universal delay applied to every scale-in operation.


13. Scale-to-Zero

One of the major advantages of event-driven scaling is the ability to scale an application to zero.

For example:

No work
0 replicas
│ New event arrives
1 replica
More events
5 replicas

This is especially useful for workloads that aren’t continuously active.

Examples include:

  • Document processing
  • Image processing
  • AI inference jobs
  • Data enrichment
  • Background processing
  • Queue consumers

When the workload disappears, the application can eventually return to zero replicas.

Azure Container Apps doesn’t charge usage charges for a container app while it is scaled to zero.


14. Authentication for KEDA Scale Rules

A KEDA scaler often needs permission to inspect the external event source.

For example, a Service Bus scaler needs access to Service Bus.

Azure Container Apps supports authentication for scale rules using:

  • Secrets
  • Managed identities for supported Azure resources

The authentication configuration is associated with the scale rule rather than requiring application code to perform the scaling operation.

Managed identity

For Azure resources, managed identity is often preferable because the application doesn’t need to store a long-lived credential.

Conceptually:

Container App
│ Managed Identity
Microsoft Entra ID
Azure Service Bus

This is generally preferable to embedding credentials in application source code.


15. Secret-Based Authentication

Scale rules can also reference secrets.

Conceptually:

Container App
├── Secret
KEDA scale rule
Event source

For example, a Service Bus connection string could be stored as a Container Apps secret and referenced by the scale rule.

Exam distinction

Don’t confuse:

Application authentication

with:

Scaler authentication

The application itself may have its own credentials or managed identity, while KEDA separately needs authorization to inspect the event source.


16. Multiple Scaling Rules

A container app can have multiple scaling rules.

For example:

Container App
├── HTTP rule
├── Service Bus rule
└── Redis rule

When multiple rules are configured, the application scales when the first applicable scaling condition is met.

This means you can combine different workload signals.

For example:

HTTP traffic ────────┐
Service Bus backlog ─┼──► Scaling decision
Redis events ────────┘

17. KEDA and Azure Container Apps Revisions

A particularly important Azure Container Apps concept is that changing scaling rules creates a new revision of the container app. A revision is an immutable snapshot of the application configuration.

Conceptually:

Revision 1
├── Old scaling rules
Update scaling configuration
Revision 2
└── New scaling rules

This matters when managing production applications using revision-based deployment strategies.


18. KEDA and Dapr

KEDA can also be used with Dapr-based applications.

For example, an application could use Dapr pub/sub:

Publisher
Dapr Pub/Sub
Subscriber Container App
KEDA

KEDA can scale the subscriber based on pending events/messages.

In this scenario, KEDA can scale both the application and its Dapr sidecar based on the workload.


19. KEDA Versus Event-Driven Container Apps Jobs

Azure Container Apps supports both:

Container Apps

A container app normally maintains a number of replicas that continuously process work.

Queue
Container App
├── Replica 1
├── Replica 2
└── Replica 3

Event-driven Container Apps Jobs

An event can instead trigger individual job executions.

Queue
├── Event 1 ──► Job execution 1
├── Event 2 ──► Job execution 2
└── Event 3 ──► Job execution 3

Both use KEDA-based scaling concepts, but the result is different.

For an application, the scaling rule determines the number of replicas.

For an event-driven job, the scaling rule determines the number of job executions to start.

Exam tip

If the question says:

“Each event should result in a separate container execution.”

Consider an event-driven Container Apps Job rather than a continuously running container app.


20. KEDA Configuration Concepts to Know

For AI-200, be comfortable recognizing these concepts:

ConceptPurpose
ScalerConnects KEDA to an event source or metric
Scale ruleDefines how Container Apps uses a scaler
MetadataProvides scaler-specific configuration
AuthenticationAllows KEDA to access the event source
minReplicasLowest number of replicas
maxReplicasHighest number of replicas
Polling intervalHow frequently KEDA checks an event source
Cooldown periodDelay associated with scaling the final replica to zero
Scale-to-zeroAllows inactive applications to have zero replicas
ReplicaAn active instance of the container app revision

21. Example Architecture

Consider an AI document-classification system.

                         ┌──────────────────┐
                         │   Web/API App    │
                         └────────┬─────────┘
                                  │
                                  │ Submit document
                                  ▼
                         ┌──────────────────┐
                         │ Azure Service    │
                         │ Bus Queue        │
                         └────────┬─────────┘
                                  │
                           Pending messages
                                  │
                                  ▼
                         ┌──────────────────┐
                         │      KEDA        │
                         │     Scaler       │
                         └────────┬─────────┘
                                  │
                           Scaling decision
                                  │
                                  ▼
                    ┌─────────────────────────┐
                    │    Azure Container App  │
                    │                         │
                    │ ┌────┐ ┌────┐ ┌────┐   │
                    │ │ R1 │ │ R2 │ │ R3 │...│
                    │ └────┘ └────┘ └────┘   │
                    └───────────┬─────────────┘
                                │
                                ▼
                         Azure AI Service
                                │
                                ▼
                            Data Store

The important point is that KEDA doesn’t process the messages.

KEDA’s responsibility is to determine how many replicas should be running.

The application replicas are responsible for processing the messages.


22. Common Exam Scenarios

Scenario 1: Queue backlog

A containerized AI worker processes Service Bus messages. The application should automatically add workers as the queue backlog increases.

Use KEDA event-driven scaling.


Scenario 2: Scale to zero

The application should consume no running replicas when there are no messages.

Configure:

minReplicas = 0

and use an appropriate event-driven scale rule.


Scenario 3: Limit cost

A sudden event spike must not cause more than 20 workers.

Configure:

maxReplicas = 20

Scenario 4: Avoid stored credentials

KEDA needs access to an Azure Service Bus resource, and the organization doesn’t want connection strings stored.

Use an appropriate managed identity configuration.


Scenario 5: Separate execution per event

Each event should start an independent container execution.

Consider an event-driven Container Apps Job rather than a continuously running container app.


23. Common Mistakes to Avoid

Mistake 1: Installing KEDA manually

For Azure Container Apps, you don’t need to deploy your own KEDA installation.

Remember: Container Apps provides the KEDA integration.


Mistake 2: Assuming KEDA only works with Kubernetes clusters

KEDA originated in the Kubernetes ecosystem, but Azure Container Apps exposes KEDA functionality without requiring you to manage Kubernetes infrastructure.


Mistake 3: Confusing KEDA with CPU autoscaling

KEDA is particularly valuable when scaling should be driven by external events or metrics, such as queue length or event backlog.


Mistake 4: Forgetting maxReplicas

Without an appropriate maximum, a large workload can potentially result in substantial scale-out.

Always consider:

minReplicas
maxReplicas

Mistake 5: Assuming scaling is instantaneous

KEDA polls event sources. The default polling interval for custom Container Apps scaling rules is 30 seconds, so there can be a delay between a change in workload and the scaling decision.


Mistake 6: Confusing cooldown with polling

These are different:

Polling interval

How frequently KEDA checks the event source.

Cooldown period

How long KEDA waits before scaling the final replica to zero after the workload becomes inactive.


24. AI-200 Exam Takeaways

For the exam, make sure you can answer these questions:

What is KEDA?

A Kubernetes-based event-driven autoscaling mechanism used by Azure Container Apps to scale workloads based on external events and metrics.

Why use KEDA?

When application demand is better represented by an external event source—such as a queue backlog—than by CPU or memory utilization.

Do you install KEDA in Container Apps?

No. Azure Container Apps provides the KEDA integration.

What controls the minimum number of replicas?

minReplicas

What controls the maximum?

maxReplicas

What determines the type of event source?

The KEDA scaler type, such as:

azure-servicebus

What does scaler metadata provide?

The scaler-specific information needed to monitor the event source and determine scaling.

Can Container Apps scale to zero?

Yes, when configured appropriately, such as with minReplicas: 0.

What is the default polling interval?

30 seconds for custom KEDA scale rules.

What is the default cooldown period?

300 seconds for custom scaling, with the cooldown specifically applying to scaling from the final replica to zero.

What happens when multiple scale rules exist?

The application begins scaling when the condition for the first applicable rule is met.


Practice Exam Questions

Question 1

An AI application running in Azure Container Apps processes messages from an Azure Service Bus queue. The application should automatically increase the number of replicas when the number of pending messages increases.

Which technology should you use?

A. Kubernetes Event-driven Autoscaling (KEDA)
B. Azure Traffic Manager
C. Azure Front Door
D. Azure DNS

Answer: A

Explanation

KEDA is designed for event-driven autoscaling. In Azure Container Apps, KEDA can monitor supported event sources such as Azure Service Bus and adjust the number of application replicas according to the workload.

The other services are primarily concerned with traffic routing or DNS rather than workload-driven container scaling.


Question 2

You configure an Azure Container App with the following settings:

minReplicas: 0
maxReplicas: 10

The application uses a KEDA-based scale rule and currently has no events to process.

What is the expected minimum number of running replicas?

A. 0
B. 5
C. 1
D. 10

Answer: A

Explanation

minReplicas specifies the minimum number of replicas. Setting it to 0 permits the application to scale to zero when the workload is inactive.

This is one of the major benefits of event-driven scaling for intermittently used workloads.


Question 3

An AI worker consumes messages from an Azure Service Bus queue. The KEDA scale rule uses a target of 20 messages per replica. There are currently 100 messages waiting.

Ignoring scaling limits and other scaling behavior, approximately how many replicas does the target calculation request?

A. 2
B. 5
C. 20
D. 100

Answer: B

Explanation

The target calculation is conceptually:

desiredReplicas = ceil(currentMetricValue / targetMetricValue)
desiredReplicas = ceil(100 / 20)
desiredReplicas = 5

Therefore, the target is approximately 5 replicas.


Question 4

An organization wants to ensure that an event-driven Container App never scales beyond 25 replicas, even when a large backlog accumulates.

Which setting should you configure?

A. pollingInterval
B. cooldownPeriod
C. minReplicas
D. maxReplicas

Answer: D

Explanation

maxReplicas establishes the maximum number of replicas that the container app can use for the configured scaling configuration.

For this requirement, configure:

maxReplicas: 25

pollingInterval controls how frequently the event source is checked, while cooldownPeriod relates to scale-down behavior. minReplicas controls the lower bound.


Question 5

A developer wants KEDA in an Azure Container App to determine scaling based on the number of pending messages in Azure Service Bus.

Which component identifies the event source and its associated scaling behavior?

A. Azure Monitor workbook
B. Container Apps ingress configuration
C. KEDA scaler
D. Azure Load Balancer

Answer: C

Explanation

A KEDA scaler connects the autoscaling mechanism to an event source or external metric. The scaler type and associated metadata define how KEDA obtains the workload information.

Ingress and load-balancing configurations don’t provide this event-driven autoscaling capability.


Question 6

An application uses a KEDA custom scale rule in Azure Container Apps. The administrator wants to understand how frequently KEDA checks the external event source by default.

Which interval should the administrator expect?

A. 5 seconds
B. 30 seconds
C. 5 minutes
D. 15 minutes

Answer: B

Explanation

The default polling interval for custom KEDA scaling rules in Azure Container Apps is 30 seconds.

This means event-driven scaling isn’t necessarily evaluated continuously or instantaneously.


Question 7

An AI application uses an Azure Service Bus queue. The organization wants KEDA to access the Azure resource without storing a long-lived Service Bus credential in the application configuration.

Which approach is most appropriate?

A. Disable authentication for the scale rule
B. Store the credential in application source code
C. Use a managed identity where supported
D. Increase the maximum replica count

Answer: C

Explanation

Azure Container Apps supports managed identity authentication for supported Azure resource scale rules.

Managed identities allow Azure resources to authenticate without requiring application developers to embed long-lived credentials in source code or configuration.


Question 8

An event-driven Container App has finished processing its queue. The application currently has one replica, and the queue remains empty.

The application is configured with the default 300-second cooldown period.

What is the purpose of the cooldown period?

A. Determine how frequently the queue is polled
B. Determine the maximum number of replicas
C. Determine the target number of messages per replica
D. Delay scaling the final replica to zero after the workload becomes inactive

Answer: D

Explanation

The cooldown period is associated with scaling from the final active replica to zero.

For Container Apps custom scaling rules, the default cooldown period is 300 seconds.

It should not be confused with the polling interval, which determines how frequently KEDA checks the event source.


Question 9

An Azure Container App has two scaling rules:

  • An HTTP scaling rule
  • An Azure Service Bus KEDA scaling rule

The Service Bus queue suddenly contains a large backlog while HTTP traffic remains low.

What happens?

A. The application can scale based on the Service Bus rule
B. Only the HTTP rule is evaluated
C. The application must use CPU scaling instead
D. The two rules are averaged before scaling

Answer: A

Explanation

Azure Container Apps can have multiple scaling rules. The application begins scaling when the condition for an applicable rule is met.

Therefore, a Service Bus backlog can cause scaling even if HTTP traffic isn’t high enough to trigger the HTTP rule.


Question 10

A development team has a workload in which each incoming event should trigger a separate container execution. The workload doesn’t need a continuously running pool of worker replicas.

Which Azure Container Apps capability is the best fit?

A. HTTP ingress scaling
B. Event-driven Container Apps Jobs
C. Azure Traffic Manager
D. TCP ingress scaling

Answer: B

Explanation

Event-driven Container Apps Jobs are designed for workloads where events trigger individual job executions.

This differs from a normal Container App, where KEDA determines how many replicas of the application should be running to process the workload.

For example:

Event 1 → Job execution 1
Event 2 → Job execution 2
Event 3 → Job execution 3

A continuously running container application would instead maintain a pool of replicas that process events.


Final Exam Cheat Sheet

TopicKey Point
KEDAEvent-driven autoscaling
Azure Container Apps + KEDAKEDA integration is managed by Container Apps
Primary use caseScale based on external events/metrics
ExamplesService Bus, Event Hubs, Kafka, Redis
minReplicasMinimum replicas
maxReplicasMaximum replicas
minReplicas = 0Allows scale-to-zero
ScalerConnects KEDA to an event source
MetadataConfigures the scaler
AuthenticationSecrets or managed identity where supported
Default polling interval30 seconds
Default cooldown300 seconds
Target calculationceil(metric / target) conceptually
Multiple rulesScaling can begin when an applicable rule triggers
Scaling-rule changesCreate a new Container Apps revision
Container AppScales replicas
Event-driven Container Apps JobScales job executions
Primary benefitEfficient scaling based on actual workload
Major advantageCan scale inactive workloads to zero

The key idea to remember for AI-200 is simple: KEDA allows Azure Container Apps to scale containerized workloads according to events and external workload metrics rather than relying solely on traditional resource utilization such as CPU or memory.


Go to the AI-200 Exam Prep Hub main page

Deploy applications to Azure Container Apps, including environment configuration and revision management (AI-200 Exam Prep)

This post is a part of the AI-200: Developing AI Cloud Solutions on Azure  Exam Prep Hub.
This topic falls under these sections:
Develop containerized solutions on Azure (20–25%)
   --> Implement container application hosting
      --> Deploy applications to Azure Container Apps, including environment configuration and revision management


Note that there are 10 practice questions (with answers) at the end of each section to help you solidify your knowledge of the material. Also, there are 4 practice tests with 30 questions each available from the hub's main page below the exam topics section.

Introduction

Azure Container Apps is a serverless container platform designed for running modern applications and microservices without requiring developers to manage the underlying Kubernetes infrastructure. For the AI-200 exam, developers should understand not only how to deploy a containerized application, but also how to configure its Container Apps environment, manage application settings, and use revisions to safely deploy and operate different versions of an application.

This topic is particularly important because Azure Container Apps separates the concepts of the application environment, the container application, and the revision. Understanding those boundaries makes many exam questions much easier to answer.


1. What Is Azure Container Apps?

Azure Container Apps provides a managed platform for running containerized applications while abstracting much of the infrastructure management associated with Kubernetes.

It is well suited for applications such as:

  • REST APIs
  • Web applications
  • Microservices
  • Background processing services
  • Event-driven applications
  • AI inference services
  • Containerized application backends

Unlike Azure Kubernetes Service, developers do not need to manage Kubernetes clusters, nodes, or the Kubernetes control plane.

Azure Container Apps can provide:

  • Containerized application hosting
  • Automatic scaling
  • Scale-to-zero capabilities
  • HTTP and TCP ingress
  • Service-to-service communication
  • Revisions and traffic splitting
  • Secrets and configuration
  • Managed identities
  • Dapr integration
  • Logging and monitoring
  • Workload profiles

For AI applications, Container Apps can be particularly useful for hosting APIs, inference services, orchestration components, and other containerized workloads.


2. Understand the Container Apps Environment

A Container Apps environment is a secure boundary around a group of Container Apps.

Multiple Container Apps can be deployed into the same environment. Apps within the same environment can share important infrastructure characteristics, including networking and logging. Microsoft describes the environment as a secure boundary for a group of container apps.

A useful mental model is:

Azure subscription → Resource group → Container Apps environment → Container Apps → Revisions

For example:

Subscription
└── Resource Group
└── Container Apps Environment
├── customer-api
│ ├── Revision 1
│ ├── Revision 2
│ └── Revision 3
├── recommendation-api
│ ├── Revision 1
│ └── Revision 2
└── document-processor
└── Revision 1

The environment therefore provides infrastructure-level isolation and shared capabilities, while the individual Container App represents an application or service running inside that environment.


3. Why the Environment Matters

When creating a Container App, you either select an existing Container Apps environment or create a new one.

Environment configuration can affect:

  • Networking
  • Logging
  • Workload profiles
  • Application isolation
  • Communication between applications
  • Infrastructure configuration

For example, applications deployed into the same environment can communicate with one another using Container Apps’ internal networking capabilities.

The environment can also be associated with logging infrastructure such as a Log Analytics workspace.

Exam Tip

If a question says that several Container Apps need to share a common environment, networking boundary, or logging configuration, think about the Container Apps environment rather than creating separate environments for every application.


4. Creating a Container App

A typical deployment involves the following conceptual steps:

  1. Create or select a resource group.
  2. Create or select a Container Apps environment.
  3. Specify the container image.
  4. Configure compute resources.
  5. Configure environment variables and secrets.
  6. Configure ingress if the application needs to receive traffic.
  7. Configure scaling.
  8. Deploy the application.
  9. Monitor the resulting revision.

For example, Azure CLI can deploy an existing container image with a command conceptually similar to:

az containerapp create \
--name my-container-app \
--resource-group my-resource-group \
--environment my-container-environment \
--image myregistry.azurecr.io/myapp:v1 \
--target-port 80 \
--ingress external

The important exam concept is not memorizing the exact command syntax. Instead, understand which configuration belongs to the environment and which belongs to the Container App.


5. Container App Configuration vs. Revision Configuration

One of the most important concepts for AI-200 is that not every change to a Container App creates a new revision.

Azure Container Apps distinguishes between:

Revision-scope changes

These changes define the version of the application and result in a new revision.

Examples include changes to:

  • Container image
  • Container configuration
  • Container resources
  • Environment variables associated with the container template
  • Scale configuration
  • Scale rules
  • Container commands and arguments
  • Probes
  • Volumes and mounts
  • Revision suffix

The Container Apps API documentation describes the template as the versioned application definition, and changes to the template result in a new immutable revision.

Application-scope changes

These changes affect the Container App configuration rather than creating a new version of the application.

Examples include:

  • Revision mode
  • Ingress configuration
  • Traffic rules
  • Secrets
  • Registry credentials
  • Dapr configuration
  • Other application-level configuration

These settings apply to the application rather than representing a new immutable revision.

Exam shortcut

When deciding whether a change creates a revision, ask:

Does this change define the versioned application template?

If yes, it is generally a revision-scope change.

If it changes how the application is configured or exposed without changing the application template, it is generally an application-scope change.


6. What Is a Revision?

A revision is an immutable snapshot of a Container App’s versioned configuration.

Think of a revision as a deployable version of the application.

For example:

customer-api
├── Revision 1 → v1 container image
├── Revision 2 → v2 container image
└── Revision 3 → v3 container image

Once created, a revision is immutable.

If you change the container image from:

myapp:v1

to:

myapp:v2

Azure Container Apps creates a new revision rather than modifying the existing revision.

This provides an important deployment-management capability:

A deployed revision represents a known version of the application.

Microsoft’s documentation describes revisions as immutable, versioned snapshots that can remain available for rollback, testing, or traffic management.


7. Why Revisions Are Important

Revisions provide several important capabilities.

Version management

You can identify different versions of an application.

Safe deployments

A new revision can be deployed without immediately replacing the existing version in multiple-revision scenarios.

Rollbacks

If a new version fails, traffic can be directed back to a previous revision.

A/B testing

Different revisions can receive different percentages of traffic.

Blue-green deployments

One revision can serve production traffic while another is deployed and validated before switching traffic.

Testing

A new revision can be tested before directing production traffic to it.

These capabilities make revisions particularly valuable for AI applications where changes to models, inference code, prompts, dependencies, or APIs may need controlled deployment.


8. Single Revision Mode

Azure Container Apps supports single revision mode and multiple revision mode. Single revision mode is the default.

In single revision mode:

  • Only one revision is active at a time.
  • A new revision is created when a revision-scoped change is deployed.
  • Azure manages the transition from the old revision to the new revision.
  • Traffic moves to the new revision after it is ready.
  • The old revision is eventually deprovisioned.

This mode is useful when the desired deployment model is essentially:

“Deploy the new version and replace the old version.”

For example:

Before deployment:
100% traffic
Revision 1
After deployment:
100% traffic
Revision 2

9. Zero-Downtime Deployment

Single revision mode is designed to avoid unnecessary downtime during deployment.

When a new revision is created, the existing revision continues serving traffic while the new revision is provisioned.

The new revision must become ready before traffic is moved.

Readiness involves factors such as:

  • Successful provisioning
  • Required replicas becoming available
  • Startup probes passing
  • Readiness probes passing

Therefore, if a new revision fails to become ready, the existing revision can continue serving traffic rather than immediately being replaced.

Exam scenario

Suppose:

  • Revision 1 is healthy.
  • Revision 2 is deployed.
  • Revision 2 fails its readiness checks.

The safest answer is generally that Revision 1 continues receiving traffic in single revision mode while Revision 2 fails to become ready.


10. Multiple Revision Mode

Multiple revision mode allows multiple revisions to remain active simultaneously.

This provides significantly more control over deployments.

For example:

                 ┌── Revision 1 ── 80%
Incoming traffic ┤
                 └── Revision 2 ── 20%

This is useful for:

  • A/B testing
  • Canary releases
  • Blue-green deployments
  • Gradual rollouts
  • Testing a new application version
  • Maintaining multiple application versions

Microsoft’s traffic-splitting functionality allows traffic to be distributed among active revisions using percentage weights. The total traffic allocation must equal 100%.


11. Traffic Splitting

In multiple revision mode, traffic can be divided among revisions.

For example:

Revision 1 → 90%
Revision 2 → 10%

This means approximately 90% of incoming traffic is routed to Revision 1 and 10% to Revision 2.

A common deployment strategy is to gradually increase the percentage assigned to the new revision:

Stage 1
v1 = 100%
v2 = 0%
Stage 2
v1 = 90%
v2 = 10%
Stage 3
v1 = 50%
v2 = 50%
Stage 4
v1 = 0%
v2 = 100%

This provides a controlled rollout.

Important exam point

Traffic weights must add up to 100%.

For example:

Revision A = 70%
Revision B = 30%

is valid.

But:

Revision A = 70%
Revision B = 20%

does not fully allocate traffic.


12. Revision Labels

Revision labels provide a way to identify a particular revision with a meaningful name.

Instead of relying entirely on an automatically generated revision name, a developer can use a label representing an environment or deployment stage.

For example:

staging
production

A labeled revision can be accessed through a label-specific endpoint.

Labels can be useful when:

  • Testing a specific revision
  • Maintaining a staging version
  • Providing direct access to a particular revision
  • Performing deployment workflows
  • Separating testing traffic from production traffic

Azure CLI provides commands for managing revision labels, including adding, removing, and swapping labels.


13. Revision Names and Suffixes

Azure Container Apps automatically generates revision names, but developers can provide a meaningful revision suffix.

For example:

customer-api-v2

could be represented conceptually by a Container App named:

customer-api

with a revision suffix such as:

v2

Meaningful revision naming can make deployment management easier.

Good naming can help identify:

  • Application version
  • Deployment stage
  • Release identifier
  • Build number
  • Feature release

However, revision names and suffixes have naming restrictions, so applications should follow Azure’s supported naming rules rather than assuming arbitrary strings are valid.


14. Deploying a New Revision

A new revision is created when a revision-scope property changes.

For example, changing:

image = myregistry.azurecr.io/customer-api:v1

to:

image = myregistry.azurecr.io/customer-api:v2

creates a new revision.

Conceptually:

Revision 1
Image: customer-api:v1
│ deploy image v2
Revision 2
Image: customer-api:v2

Revision 1 remains an independent immutable version.

This is one of the most important concepts to understand for exam questions involving deployments.


15. Rollbacks

Suppose Revision 2 introduces a serious problem:

Revision 1 → stable
Revision 2 → defective

In a multiple-revision deployment, traffic can be redirected back to Revision 1.

For example:

Before rollback:
Revision 1 → 20%
Revision 2 → 80%
After rollback:
Revision 1 → 100%
Revision 2 → 0%

The existing revision doesn’t need to be rebuilt because the previous revision already represents the known-good application version.

This is one of the primary benefits of immutable revisions.


16. Blue-Green Deployments

Azure Container Apps revisions can be used to implement a blue-green deployment strategy.

For example:

BLUE
Revision 1
Production
100% traffic
GREEN
Revision 2
New version
0% traffic

The new revision can be tested while receiving no production traffic.

Once validation is complete:

BLUE → 0%
GREEN → 100%

The new version becomes the production version.

If a problem occurs:

BLUE → 100%
GREEN → 0%

This provides a fast rollback mechanism.


17. Canary Deployments

Multiple revisions can also support a canary release.

For example:

Stable revision → 95%
New revision → 5%

Only a small percentage of users initially reach the new version.

If the new version performs well, the deployment can gradually increase its traffic allocation:

95/5
80/20
50/50
20/80
0/100

This is especially useful for AI applications because a new model or inference implementation can be exposed to a limited portion of traffic before being fully deployed.


18. Scaling and Revisions

Scaling configuration can also be revision-scoped.

For example, a Container App might use:

Minimum replicas: 1
Maximum replicas: 10

and scale based on HTTP concurrency.

Changing the application’s scale configuration can result in a new revision because scale settings are part of the versioned template.

This is important because two revisions can potentially have different scaling configurations.

For example:

Revision 1
min replicas = 1
max replicas = 5
Revision 2
min replicas = 2
max replicas = 20

In multiple revision mode, these revisions can coexist with their respective configurations.


19. Ingress Configuration

Ingress determines how network traffic reaches a Container App.

Depending on the application, ingress can be:

  • External
  • Internal

External ingress makes the application accessible from outside the environment.

Internal ingress is useful when the application should only be reachable from within the environment or associated network configuration.

Container Apps supports HTTP and TCP-oriented ingress scenarios, with HTTP/1.1, HTTP/2, and TCP transport options depending on the configuration and workload.

Exam clue

If a question asks:

“The application must be accessible from the public internet.”

Look for an external ingress configuration.

If it asks:

“The API should only be accessible by other applications inside the Container Apps environment.”

Look for internal ingress.


20. Environment Variables

Containerized applications frequently require configuration values such as:

ENVIRONMENT=Production
MODEL_NAME=my-model
API_ENDPOINT=https://example

These values can be provided as environment variables.

Environment variables are part of the container configuration and therefore can be associated with a revision.

For example:

Revision 1
API_ENDPOINT = endpoint-v1
Revision 2
API_ENDPOINT = endpoint-v2

This is important when different application versions need different configuration.


21. Secrets

Sensitive information should not be hard-coded into container images.

Examples include:

  • API keys
  • Passwords
  • Connection strings
  • Tokens
  • Credentials

Azure Container Apps supports secrets that can be referenced by container environment variables.

Conceptually:

Container
└── Environment variable
└── secretRef
Container App Secret

The Container Apps API supports environment variables that reference Container App secrets using secretRef.

For more advanced secret-management requirements, Azure Key Vault can be used rather than embedding credentials directly in the application.

Exam Tip

If the question asks where to store a password or API key, do not choose a Dockerfile or hard-coded environment variable.

Think:

Secret management → Container Apps secrets / Azure Key Vault


22. Private Container Registries

Container Apps can deploy images from private container registries.

For example:

Azure Container Registry
│ image
Azure Container Apps

The Container App must have appropriate authorization to pull the image.

For Azure-hosted workloads, managed identities can often be used to avoid embedding long-lived credentials.

This follows an important security principle:

Prefer identity-based authentication over hard-coded credentials.


23. Container Apps and Azure Container Registry

A common AI-200 deployment architecture is:

Developer
Build container image
Azure Container Registry
Azure Container Apps
├── Revision 1
└── Revision 2

Azure Container Registry stores the container image while Azure Container Apps runs the container.

A new image version can then be deployed as a new revision.

For example:

my-ai-api:v1
my-ai-api:v2
my-ai-api:v3

Each deployment can correspond to a new revision.


24. Environment Configuration vs. Revision Management

A useful exam distinction is:

ConceptPurpose
Container Apps environmentShared boundary and infrastructure context
Container AppThe application/service
RevisionImmutable version of the application
Revision modeDetermines how revisions are activated
IngressControls how traffic reaches the application
Traffic splittingDetermines how traffic is distributed
Revision labelProvides identifiable access to a revision
SecretStores sensitive configuration
Environment variableSupplies application configuration
Scale configurationDetermines how the application responds to demand

Understanding these distinctions helps prevent choosing an answer that sounds plausible but operates at the wrong level.


25. A Typical Deployment Lifecycle

A production deployment might look like this:

Step 1 — Build

Create the container image.

AI application source
Docker build
Container image

Step 2 — Store

Push the image to Azure Container Registry.

Container image
Azure Container Registry

Step 3 — Deploy

Deploy the image to Azure Container Apps.

Registry
Container App
Revision 1

Step 4 — Update

Deploy a new image.

Registry
Container App
Revision 2

Step 5 — Validate

Check:

  • Provisioning state
  • Running state
  • Replica health
  • Application logs
  • Health probes
  • Application metrics

Step 6 — Route traffic

In multiple revision mode:

Revision 1 → 90%
Revision 2 → 10%

Step 7 — Complete rollout

If the new revision is healthy:

Revision 1 → 0%
Revision 2 → 100%

Step 8 — Roll back if necessary

If problems appear:

Revision 1 → 100%
Revision 2 → 0%

This workflow illustrates why revisions are such an important Azure Container Apps capability.


26. Common Exam Traps

Trap 1: Assuming every configuration change creates a revision

Not every change creates a new revision.

Remember the distinction between revision-scope and application-scope configuration.


Trap 2: Assuming revisions are mutable

Revisions are immutable.

To change the versioned application configuration, deploy a new revision.


Trap 3: Confusing single and multiple revision modes

Single mode is designed around one active revision.

Multiple mode allows several revisions to be active simultaneously.


Trap 4: Using traffic splitting in single mode

Traffic splitting requires multiple active revisions.

If the question specifically requires distributing traffic between two versions, look for multiple revision mode.


Trap 5: Assuming a failed new revision automatically replaces the healthy one

Azure Container Apps provides mechanisms that help maintain availability during deployment. In single revision mode, the existing revision can continue serving traffic while the new revision is being prepared.


Trap 6: Confusing a Container Apps environment with a Container App

The environment is the broader hosting boundary.

The Container App is the actual application.

Multiple Container Apps can exist within an environment.


Trap 7: Hard-coding secrets into a container

Passwords and API keys should not be placed directly into application code or container images.

Use appropriate secret-management capabilities.


Trap 8: Forgetting that scale configuration can be revision-specific

Scale configuration belongs to the versioned application template and can therefore create a new revision when changed.


27. AI-200 Exam Summary

For the AI-200 exam, remember these core points:

  1. Azure Container Apps provides managed hosting for containerized applications.
  2. A Container Apps environment provides a secure boundary for a group of Container Apps.
  3. Multiple Container Apps can share the same environment.
  4. A revision represents an immutable version of a Container App.
  5. Changes to revision-scoped properties create new revisions.
  6. Application-scoped changes don’t create new revisions.
  7. Single revision mode is the default.
  8. Multiple revision mode allows multiple active revisions.
  9. Traffic can be split between active revisions in multiple mode.
  10. Traffic weights must total 100%.
  11. Revisions support blue-green deployments.
  12. Revisions support canary and A/B testing scenarios.
  13. Previous revisions can provide a convenient rollback target.
  14. Revision labels can provide meaningful access to particular revisions.
  15. Environment variables provide application configuration.
  16. Secrets should be used for sensitive values.
  17. Container Apps can pull images from container registries such as Azure Container Registry.
  18. Managed identities can reduce the need for embedded credentials.
  19. Ingress determines how applications receive network traffic.
  20. Health probes and application readiness are important during deployment.
  21. Scaling configuration can be revision-specific.
  22. Understanding the difference between environment, application, revision, and traffic configuration is essential for scenario-based questions.

Practice Exam Questions

Question 1

You deploy a container app named orders-api using revision 1. You then change the container image from orders:v1 to orders:v2.

What happens when the change is deployed?

A. Revision 1 is modified in place.

B. A new revision is created containing the new container image.

C. The Container Apps environment is recreated.

D. The application is automatically moved to another region.

Answer: B

Explanation

The container image is part of the versioned container template. Changing the image is therefore a revision-scope change, which causes a new immutable revision to be created. Revision 1 remains unchanged. Azure’s Container Apps API identifies the container template as versioned and states that changes to it create a new revision.


Question 2

An organization has three Container Apps that need to share a common networking boundary and logging infrastructure.

What should you create?

A. A separate revision for each application.

B. A single Container Apps environment containing the three applications.

C. A single container image containing all three applications.

D. A separate Azure Kubernetes Service cluster for each application.

Answer: B

Explanation

A Container Apps environment provides a secure boundary around a group of Container Apps. Applications within the same environment can share environment-level capabilities such as networking and logging.


Question 3

You need to gradually introduce a new version of an API. Initially, 95% of requests should go to the existing revision and 5% should go to the new revision.

Which configuration should you use?

A. Single revision mode with an environment variable.

B. A new Container Apps environment.

C. Multiple revision mode with traffic splitting.

D. A second container inside the same revision.

Answer: C

Explanation

Multiple revision mode allows multiple revisions to remain active simultaneously and supports percentage-based traffic splitting. This makes it appropriate for gradual or canary deployments.


Question 4

A Container App is currently configured in single revision mode. A developer deploys a new revision, but the new revision fails its readiness checks.

What is the expected behavior?

A. The existing healthy revision can continue serving traffic while the new revision fails to become ready.

B. All revisions are immediately deactivated.

C. The environment is automatically deleted.

D. Traffic is automatically divided equally between the failed and healthy revisions.

Answer: A

Explanation

In single revision mode, Azure Container Apps maintains the existing revision while the new revision is being provisioned. The new revision must become ready before traffic is moved to it. This helps support zero-downtime deployments.


Question 5

You need to deploy a new revision for testing while keeping the current production revision at 100% traffic. The test revision should remain available so developers can test it directly.

Which approach is most appropriate?

A. Use single revision mode and delete the production revision.

B. Create a second Container Apps environment and duplicate the application.

C. Modify the existing production revision in place.

D. Use multiple revision mode and keep the test revision active with appropriate traffic allocation or a revision label.

Answer: D

Explanation

Multiple revision mode allows several revisions to remain active. A revision can also be associated with a label to provide direct access to a particular revision. This is useful for staging and testing scenarios without immediately shifting production traffic.


Question 6

A developer changes an application’s revision mode from Single to Multiple.

Does changing the revision mode itself create a new revision?

A. Yes. Every configuration change creates a revision.

B. Yes, but only if traffic splitting is also configured.

C. No. Revision mode is an application-scope configuration.

D. No, because revision mode is stored in the container image.

Answer: C

Explanation

Revision mode is an application-scope configuration setting. Changing the revision mode does not itself create a new revision. Azure’s current API documentation identifies activeRevisionsMode as part of the non-versioned Container App configuration.


Question 7

An application has two active revisions configured with traffic weights of 70% and 20%.

What is wrong with this configuration?

A. Traffic splitting can only be 50/50.

B. Traffic weights must total 100%.

C. Multiple revision mode only supports two revisions.

D. Traffic splitting requires three revisions.

Answer: B

Explanation

Traffic weights define the percentage of incoming traffic routed to each revision. The combined weights must equal 100%. A 70% + 20% configuration accounts for only 90% of traffic.


Question 8

An AI inference API stores an Azure OpenAI API key in its container image.

What is the best improvement?

A. Move the key into a Dockerfile argument.

B. Put the key into the container image as an encrypted text file.

C. Store the key in a Container Apps secret or an appropriate external secret-management service such as Azure Key Vault.

D. Put the key directly into the application’s source code.

Answer: C

Explanation

Secrets such as API keys and passwords should not be embedded in source code or container images. Container Apps supports secrets that can be referenced by environment variables, while Azure Key Vault provides centralized secret management for more advanced scenarios. The Container Apps API supports secretRef for connecting environment variables to Container App secrets.


Question 9

You are implementing a blue-green deployment. Revision 1 is currently serving production traffic. Revision 2 contains a new version that has been fully tested.

What should you do to switch production to Revision 2 while retaining the ability to quickly roll back?

A. Delete Revision 1 immediately.

B. Update Revision 1 so it contains Revision 2’s code.

C. Create a new Container Apps environment and redirect DNS.

D. Shift production traffic from Revision 1 to Revision 2 while keeping Revision 1 available.

Answer: D

Explanation

Revisions are immutable versions of an application. A blue-green deployment can maintain the existing revision while the new revision is validated. Production traffic can then be shifted to the new revision. Keeping the previous revision available provides a straightforward rollback target if problems occur.


Question 10

You have an application running in multiple revision mode:

Revision A → 80%
Revision B → 20%

You change the container image used by Revision B.

What should you expect?

A. Revision B is modified in place while retaining its existing revision identity.

B. The Container Apps environment is recreated.

C. A new revision is created containing the changed container image.

D. Revision A is automatically deleted.

Answer: C

Explanation

The container image is part of the revision’s versioned template. Changing it creates a new revision rather than modifying the existing immutable revision. The new revision can then be activated and assigned traffic according to the application’s revision configuration.


Final Exam Takeaway

The easiest way to reason about Azure Container Apps deployment questions is to think in terms of layers:

CONTAINER APPS ENVIRONMENT
│ Shared hosting/networking boundary
CONTAINER APP
│ Application configuration
REVISION
│ Immutable version
CONTAINER IMAGE + TEMPLATE + SCALE CONFIGURATION

Then ask:

Does the question involve the hosting boundary?
→ Think Container Apps environment.

Does it involve the application itself?
→ Think Container App configuration.

Does it change the versioned application template?
→ Think new revision.

Does it require multiple versions to run simultaneously?
→ Think multiple revision mode.

Does it require controlled percentages of traffic?
→ Think traffic splitting.

Does it require a gradual rollout?
→ Think canary deployment.

Does it require switching between old and new versions?
→ Think blue-green deployment.

Does it require returning to a known-good version?
→ Think previous revision and rollback.

Mastering those distinctions will cover a substantial portion of the scenario-based questions you are likely to encounter around deploying applications to Azure Container Apps for AI-200.


Go to the AI-200 Exam Prep Hub main page