Question

Difficulty: Very hardConfigure Azure Monitor Autoscale Rules and Metrics

An organization deploys a background processing application to an Azure App Service Plan in the East US region. The application processes tasks from an Azure Service Bus queue named `task-queue` in the same region.

To handle spikes in workload, you configure an autoscale setting on the App Service Plan with the following scale-out rule:
- Metric source: Service Bus Queue (`task-queue`)
- Metric name: `ActiveMessages`
- Time Grain (Frequency): 11-minute
- Time Window: 1010-minutes
- Time Aggregation: `Total`
- Operator: `GreaterThan`
- Threshold: 500500
- Scale Action: Increase count by 22

During a period of stable, low traffic, the queue maintains a steady backlog of approximately 6060 active messages. However, you observe that the App Service Plan unexpectedly scales out to its maximum instance count.

Which of the following is the root cause of this unexpected scaling behavior?

  1. A
    The App Service Plan and the Service Bus namespace are located in the same region, which causes a routing conflict for Azure Monitor cross-resource metrics.
  2. The `Total` time aggregation sums the samples over the 1010-minute window, resulting in an evaluated metric value of approximately 600600, which exceeds the threshold of 500500.Answer
  3. C
    The `ActiveMessages` metric is a cumulative counter that only increases, meaning any aggregation other than `Average` will fail to compute the rate of change.
  4. D
    Scaling an App Service Plan based on external Service Bus metrics is unsupported on standard hosting plans, requiring an Isolated App Service Environment.

Answer

The scale-out rule triggers because the 'Total' time aggregation sums the samples of the queue size (approximately 6060 messages) over the 1010-minute window (1010 samples of 11 minute each), resulting in an evaluated value of approximately 600600, which exceeds the threshold of 500500.
The correct answer is correct because using the 'Total' time aggregation sums the point-in-time samples of the queue size (approximately 6060 messages) over the 1010-minute window (1010 samples of 11 minute each), resulting in an aggregated value of approximately 600600. Since this value exceeds the threshold of 500500, it triggers the scale-out action. To monitor queue lengths correctly, 'Average' or 'Maximum' aggregation must be used.

Step-by-Step Solution

1
Analyze the sampling rate and the time window of the autoscale metric trigger.
The rule uses a Time Grain (frequency) of 11 minute and a Time Window of 1010 minutes, meaning 1010 metric samples are collected and evaluated during each autoscale check.
To understand how the metric value is calculated, we must determine the number of samples collected within the evaluation window.
2
Calculate the aggregated metric value based on the 'Total' Time Aggregation type and the steady backlog.
Under a stable workload of 6060 messages, each of the 1010 samples has a value of approximately 6060. Using 'Total' aggregation, the sum of these samples is calculated: 60×10=60060 \times 10 = 600.
The 'Total' aggregation sums all samples in the time window rather than taking the average, minimum, or maximum value.
3
Compare the aggregated metric value against the configured scale-out threshold.
The calculated value of 600600 is compared to the threshold of 500500. Since 600>500600 > 500, the operator GreaterThan is satisfied, and the scale-out action (Increase count by 22) is triggered.
This explains why the App Service Plan scales out to its maximum instance count even under low, stable traffic.

Key Concept

Azure Monitor Autoscale Cross-Resource Metrics and Time Aggregation Types
Rate this question