AZ-204 Develop Azure compute solutions Practice Question
You are designing a solution that uses Azure Container Instances (ACI) to run a batch job. The job must run only once a day and should not incur costs when idle. Which configuration should you use?
⚠ Common exam trap
Watch out — candidates often confuse the 'restart policy' with cost management, assuming 'Always' or 'OnFailure' are acceptable, or they may overcomplicate the solution by choosing AKS or Container Apps, which introduce unnecessary complexity and cost for a simple scheduled batch job.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Use a scheduled job that creates a container group with restart policy Never and delete after completion
Azure Container Instances (ACI) supports a restart policy of 'Never' for one-off batch jobs, and you can orchestrate the creation and deletion of the container group using a scheduled job (e.g., Azure Logic Apps, Azure Functions, or a cron-based trigger). This ensures the container runs exactly once per day and incurs no cost when idle, as the container group is deleted after completion.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Use Azure Kubernetes Service with a node pool that scales to zero
Why it's wrong here
Using Azure Kubernetes Service (AKS) with a node pool that scales to zero, while seemingly cost-effective, still incurs costs associated with the AKS control plane and potentially a minimum number of system pods that require compute resources. AKS is fundamentally designed for orchestrating long-running, complex microservices, not for single, ephemeral tasks where the overhead of the Kubernetes management plane would be disproportionately expensive.
- ✗
Deploy a container group with a restart policy of Always
Why it's wrong here
Deploying a container group with a restart policy of Always is intended for continuous services that should remain running or automatically recover from failures. For a solution aiming to minimize cost for a single, transient task, this policy is inappropriate because the container would continuously attempt to restart and consume resources even after its initial job is complete, leading to unnecessary ongoing charges.
- ✓
Use a scheduled job that creates a container group with restart policy Never and delete after completion
Why this is correct
This approach is optimal for cost efficiency. A scheduled job can programmatically create an Azure Container Instance (ACI) container group, which offers per-second billing. Setting the restart policy to Never ensures the container stops and releases all compute resources immediately upon successful completion, while explicitly deleting the container group after its run guarantees no lingering charges, making it ideal for one-off, batch-like tasks.
- ✗
Use Azure Container Apps with scale-to-zero minimum replicas
Why it's wrong here
Azure Container Apps (ACA) provide scale-to-zero functionality for HTTP-triggered or event-driven applications, but they operate within an environment that has a base cost, even when no replicas are actively running. This underlying environment cost, coupled with the platform's focus on long-running microservices and event processing, makes ACA less suitable for achieving absolute minimal cost for a single, non-persistent, scheduled task compared to the granular, serverless billing of ACI.
Quick reference
Cloud Service Model Comparison
| Model | You Manage | Provider Manages | Examples |
|---|---|---|---|
| IaaS | OS, runtime, apps, data | Hardware, hypervisor, networking | EC2, Azure VMs, GCP Compute Engine |
| PaaS | Apps and data | OS, runtime, middleware, hardware | Elastic Beanstalk, Azure App Service |
| SaaS | Data and settings only | Everything else | Microsoft 365, Salesforce, Workday |
| FaaS / Serverless | Function code only | Infra, scaling, runtime | Lambda, Azure Functions, Cloud Run |
| CaaS | Containers and apps | Kubernetes, OS, hardware | EKS, AKS, GKE |
Go deeper
Related to this question
Learn chapter
Azure Functions Development
Key term
Azure Container Instances
Azure Container Instances (ACI) is a PaaS service that lets you run a container directly in Azure without managing any underlying servers or orchestration.
Key term
Azure Functions Bindings
Azure Functions Bindings are declarative connections that link your serverless function code to Azure services or external resources, handling input and output data automatically without writing extra networking or authentication code.
About these practice questions
One of 881 original AZ-204 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This AZ-204 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AZ-204 exam.