Courseiva
Question 732 of 881
Develop Azure compute solutionshardMultiple ChoiceObjective-mapped

AZ-204 Develop Azure compute solutions Practice Question

You are developing an Azure Function that runs on a Consumption Plan. The function calls an external API that enforces a rate limit of 10 requests per second. When the function scales out to multiple instances, you must ensure the rate limit is not exceeded. Which pattern should you implement?

⚠ Common exam trap

Test-takers frequently confuse concurrency control within a single instance (Options B and C) with global rate limiting across scaled-out instances, leading them to overlook the need for a distributed coordination mechanism like queue-based load leveling.

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 queue-based load leveling pattern with an Azure Storage Queue.

A queue-based load leveling pattern uses an Azure Storage Queue to buffer incoming requests, allowing the function to process them at a controlled rate. This decouples the function's scaling from the external API's rate limit, ensuring that even with multiple function instances, the total request rate does not exceed 10 requests per second. The queue acts as a buffer, and the function can be configured to dequeue and process messages at a fixed rate, effectively smoothing out spikes in demand.

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 a singleton attribute on the function to ensure only one instance runs.

    Why it's wrong here

    The `[Singleton]` attribute ensures only one instance of a specific function executes across all scale units at a time. While it prevents concurrent function instances, it does not inherently throttle the *rate* at which that single instance makes calls to an external API. A single, long-running function execution could still rapidly exceed a per-second rate limit if its internal logic is not explicitly designed for throttling.

  • Use a static SemaphoreSlim in the function code to limit concurrent calls.

    Why it's wrong here

    A `static SemaphoreSlim` within a function's code limits concurrent calls *within that specific application instance*. However, Azure Functions on a Consumption plan can scale out to multiple, independent instances across different virtual machines. Each instance would possess its own distinct static `SemaphoreSlim`, failing to coordinate a global rate limit across the entire distributed function app.

  • Configure the function's host.json to limit concurrency to 1.

    Why it's wrong here

    Configuring `maxConcurrentCalls` to 1 in `host.json` for a specific trigger ensures only one execution of that function is processed at a time *per host instance*. While this prevents parallel executions, it does not inherently control the *frequency* or *rate* of API calls made *within* that single, active execution. A single function execution could still make numerous rapid calls to the external API, easily exceeding a 10-calls-per-second rate limit.

  • Use a queue-based load leveling pattern with an Azure Storage Queue.

    Why this is correct

    The queue-based load leveling pattern is ideal for managing external API rate limits. Incoming requests are placed into an Azure Storage Queue, decoupling the ingestion rate from the processing rate. A separate function, triggered by the queue, then processes these messages at a controlled pace, implementing throttling mechanisms like deliberate delays between API calls or batch processing with pauses, ensuring the external API's rate limit is consistently respected regardless of the function app's scale.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Last reviewed: Jun 11, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

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.