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?
- ATarget 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.
- 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.Cevap
- CTarget 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.
- DChange 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.
Cevap
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.
Adım Adım Çözüm
Anahtar Kavram
Configuring autoscale rules based on external metrics and filtering by dimensions in Azure Monitor.