Courseiva

AZ-204 Practice Question: Connect to and consume Azure services and third-party services

A developer is building a function app that processes messages from an Azure Storage queue. The function must scale automatically based on queue length. Which hosting plan supports this automatic scaling?

⚠ Common exam trap

Many candidates confuse the Premium plan's always-ready instances and VNet integration with being the only plan that scales automatically, but the Consumption plan is the original and primary plan for automatic, event-driven scaling based on queue length.

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

Consumption plan

The Consumption plan is correct because it is a primary Azure Functions hosting plan that provides true automatic scaling based on event-driven triggers, such as queue length. In this plan, the Azure Functions host dynamically adds or removes instances, scaling from zero when idle, up to a maximum of 200 (default) based on the number of messages in the Storage queue. It uses a target-based scaling strategy that monitors queue depth and backlog, making it the default and most cost-effective option for workloads that need to scale to zero and burst to handle large message volumes. While the Premium plan also supports automatic scaling based on event triggers, it maintains at least one warm instance and does not scale to zero.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Consumption plan

    Why this is correct

    The Consumption plan is the quintessential serverless hosting option for Azure Functions, automatically scaling out instances based on the volume of incoming events, such as messages in a queue. It offers a pay-per-execution billing model, meaning you only pay for the compute resources consumed while your function is actively running. This makes it highly cost-effective and ideal for event-driven architectures where workloads can be unpredictable or bursty, perfectly suiting a function app processing messages.

  • Premium plan

    Why it's wrong here

    While the Azure Functions Premium plan also offers automatic scaling and eliminates cold starts with pre-warmed instances, it incurs a higher base cost due to its dedicated, pre-allocated resources. It's typically chosen for scenarios requiring VNet integration, longer execution durations, or more predictable performance guarantees, rather than simply being the most minimal or cost-effective solution for a basic message processing function app. Therefore, it's not the optimal choice if cost-efficiency and pure serverless elasticity are the primary drivers.

  • App Service plan

    Why it's wrong here

    Hosting an Azure Function on an App Service plan means it runs on dedicated virtual machines, requiring either manual scaling or configuring explicit auto-scale rules based on metrics like CPU or memory usage. Unlike the Consumption plan, it does not automatically scale based on the number of messages in a queue or other event sources. This approach results in continuous billing for the underlying VM instances, regardless of whether functions are actively executing, making it less suitable and cost-effective for event-driven, intermittent workloads like message processing.

  • Azure Container Instances

    Why it's wrong here

    Azure Container Instances (ACI) provides a way to run Docker containers directly in Azure without managing virtual machines or orchestrators. While you *can* containerize an Azure Function and deploy it to ACI, ACI itself is not a native hosting plan *for* Azure Functions in the same way Consumption, Premium, or App Service plans are. Azure Functions are designed to run on specific Azure Functions hosting infrastructure, which provides the necessary runtime and scaling capabilities directly, making ACI an indirect and generally less integrated approach for typical Function App deployments.

Quick reference

Cloud Service Model Comparison

ModelYou ManageProvider ManagesExamples
IaaSOS, runtime, apps, dataHardware, hypervisor, networkingEC2, Azure VMs, GCP Compute Engine
PaaSApps and dataOS, runtime, middleware, hardwareElastic Beanstalk, Azure App Service
SaaSData and settings onlyEverything elseMicrosoft 365, Salesforce, Workday
FaaS / ServerlessFunction code onlyInfra, scaling, runtimeLambda, Azure Functions, Cloud Run
CaaSContainers and appsKubernetes, OS, hardwareEKS, AKS, GKE

Go deeper

Related to this question

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 →

How Courseiva writes practice questions · Editorial policy

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.