Configuring KEDA Scale Rules for Azure Storage Queues

AI-200 By islever Editorial Last updated

Implement container-orchestrated solutions

Short answer

BD Configure the Trigger type to select the Azure Storage Queue scaler and the Queue name to identify the specific queue driving the scale rule.

Question

An ACA app processes messages from an Azure Storage queue. The app must scale automatically based on messages in a specific Azure Storage queue by using a Kubernetes Event-driven Autoscaler (KEDA) custom scale rule. You need to configure the required scale rule values. Which two values should you configure? Each correct answer presents part of the solution. Choose two.
  1. Maximum replicas
  2. Queue name Correct Answer
  3. Polling interval
  4. Trigger type Correct Answer

Key Takeaways

When configuring Kubernetes Event-driven Autoscaler (KEDA) for Azure Container Apps, the scale rule must specify the Trigger type to select the correct scaler and the Queue name to identify the target resource. These two settings are essential for KEDA to monitor message counts and trigger scaling actions appropriately.

Expert Analysis

A KEDA custom scale rule must identify what scaler to use and which resource within that scaler should be observed. For Azure Storage queues, the trigger type selects the Storage Queue scaler and the queue name identifies the specific queue whose message count drives scaling.

To successfully configure Kubernetes Event-driven Autoscaler (KEDA) for an application hosted on Azure Container Apps (ACA) that processes messages from a specific Azure Storage queue, it is critical to distinguish between parameters that define the source of the scaling metric and those that define the behavior or limits of the scaling operation. The core requirement here is to tell KEDA exactly where to look for data to make scaling decisions. Without this identification, KEDA cannot retrieve the necessary metrics to determine if the workload needs to scale up or down.

The first essential configuration value is the Trigger type (Option D). In the context of KEDA, the trigger type specifies the external system or service from which metrics are pulled. For Azure scenarios, this involves selecting the appropriate scaler, such as azure-queue. This setting acts as the foundational instruction to KEDA, informing it to utilize the Azure Storage Queue scaler logic rather than another scaler like CPU/Memory or HTTP. If this is not correctly set, KEDA will not know which plugin to load or how to authenticate with the Azure Storage API to fetch message counts. It is the mechanism that bridges the Kubernetes Horizontal Pod Autoscaler (HPA) with the Azure-specific monitoring infrastructure.

The second required value is the Queue name (Option B). Once the trigger type is established as the Azure Storage Queue scaler, KEDA needs to know the specific target resource to monitor. An Azure Storage account can contain multiple queues. To ensure the autoscaler reacts to the backlog in the correct queue, the queueName parameter must be explicitly configured. This value points KEDA to the exact queue instance whose message count serves as the threshold for scaling events. Without specifying the queue name, the scaler would either fail to connect or monitor the wrong resource, leading to incorrect scaling behavior.

Why the other options are incorrect in this specific context:

Maximum replicas (Option A) is a constraint applied at the level of the KEDA ScaledObject or the underlying HPA. It defines the upper bound of pods that can be created but does not influence the decision-making process of when to scale. It is a safety limit, not a trigger definition. While important for capacity planning, it is not part of the "scale rule" that identifies the metric source.

Polling interval (Option C) determines how frequently KEDA checks the external system for new metrics. While this affects the responsiveness of the autoscaler (e.g., checking every 5 seconds vs. 30 seconds), it is an optional tuning parameter. The scaler can function without a custom polling interval, defaulting to a standard value. More importantly, it does not identify what is being polled. Therefore, it is not a mandatory component of the rule that defines the connection to the storage queue.

This distinction highlights a common pitfall in cloud-native development: confusing operational constraints (replicas, intervals) with declarative triggers (type, name). In ACA with KEDA, the "rule" primarily refers to the mapping of an external event source to the scaling engine. The two non-negotiable elements are identifying the source type and the specific instance of that source.

Furthermore, understanding the interaction between ACA and KEDA reinforces this. ACA manages the lifecycle of the container app, while KEDA injects the event-driven scaling capability. The KEDA ScaledObject resource in Kubernetes requires these metadata fields to create a valid connection to the Azure Monitor APIs. Omitting the queue name results in a configuration error because the scaler cannot resolve the endpoint. Omitting the trigger type results in a null reference because no scaler plugin is activated. Thus, B and D are the only values that constitute the actual "scale rule" for the metric source.

Exam Strategy

When asked to configure event-driven scaling rules, always separate 'metric source' parameters from 'scaling behavior' parameters. Identify the option that names the external system (trigger/scaler type) and the option that names the specific resource instance (queue/topic/table name). Options related to limits (max/min replicas), frequency (polling intervals), or thresholds (target values) are secondary tuning controls, not primary identifiers required to establish the connection.

Practice All AI-200 Questions

Access 69 questions with complete answers and detailed explanations.

View Full AI-200 Practice Test →

← Back to AI-200 Study Guide