Question

Difficulty: HardConfigure Azure Monitor Autoscale Rules and Metrics

You are developing a backend processing service that runs on an Azure App Service plan named `asp-worker` (currently on the Standard S1 tier). The service processes messages from an Azure Service Bus queue named `task-queue` within a Service Bus namespace named `sb-namespace-prod`.

You need to configure an Azure Monitor autoscale rule to increase the instance count of `asp-worker` when the volume of unprocessed tasks increases.

How should you configure the scale-out metric trigger?

  1. A
    Target the Service Bus queue directly as the metric resource, set the metric namespace to Microsoft.ServiceBus/namespaces/queues, and set the metric name to ActiveMessages without any dimensions.
  2. Target the Service Bus namespace as the metric resource, set the metric namespace to Microsoft.ServiceBus/namespaces, set the metric name to ActiveMessages, and add a dimension filter where DimensionName is set to EntityName and Values is set to the name of the queue.Answer
  3. C
    Target the Service Bus namespace as the metric resource, set the metric namespace to Microsoft.ServiceBus/namespaces, set the metric name to ActiveMessages, and add a dimension filter where DimensionName is set to QueueName and Values is set to the name of the queue.
  4. D
    Change the App Service plan to the Basic (B1) tier to enable custom external metric scaling, target the Service Bus namespace as the metric resource, and set the metric name to ActiveMessages.

Answer

Target the Service Bus namespace as the metric resource, set the metric namespace to Microsoft.ServiceBus/namespaces, set the metric name to ActiveMessages, and add a dimension filter where DimensionName is set to EntityName and Values is set to the name of the queue.
The correct configuration requires setting the metric source to the namespace level because Azure Monitor aggregates Service Bus metrics at the namespace level. To isolate and target a specific queue within that namespace, the EntityName dimension filter must be applied. Furthermore, the App Service plan must remain on a supported pricing tier, such as the Standard S1 tier, since the Basic tier does not support autoscaling.

Step-by-Step Solution

1
Determine the correct metric resource target and namespace.
Identify that Azure Monitor exposes Service Bus metrics at the namespace level (Microsoft.ServiceBus/namespaces) rather than individual queue resource endpoints.
Azure Monitor does not allow targeting individual queue resources directly for autoscaling metrics.
2
Identify the correct dimension to isolate the target queue.
Determine that the dimension name for filtering Service Bus namespace metrics by queue or topic name is EntityName.
Using dimensions allows the autoscale rule to aggregate active messages for only the queue processing the workload, rather than the entire namespace.
3
Verify App Service Plan pricing tier requirements.
Confirm that the App Service plan must remain on a tier that supports custom autoscale rules (Standard, Premium, or Isolated).
The Basic (B1) tier only supports manual scaling, so moving to the Basic tier would make metric-based autoscaling impossible.

Key Concept

Configuring autoscale rules based on external metrics and filtering by dimensions in Azure Monitor.
Rate this question