You are designing autoscaling for a Virtual Machine Scale Set (VMSS) that processes messages from an Azure Service Bus queue. The number of messages in the queue fluctuates significantly throughout the day. You want the VMSS to scale out when the queue depth exceeds 500 messages and scale in when it drops below 100. Which scaling approach should you configure?
- A. Schedule-based autoscaling with a fixed instance count during business hours
- B. Metric-based autoscaling using average CPU percentage across the VMSS instances
- C. Manual scaling with an Azure Automation runbook that checks the queue every 5 minutes
- D. Metric-based autoscaling using the Azure Service Bus queue message count metric✓ Correct
Explanation
Metric-based autoscaling in VMSS supports custom metrics from Azure resources, including Service Bus queue message count (an Azure Monitor metric). You can define scale-out rules (queue depth > 500) and scale-in rules (queue depth < 100), making this a direct and native solution. — Schedule-based autoscaling scales on a time schedule regardless of actual queue depth, so it cannot react to the dynamic fluctuations described. — Manual scaling with an Automation runbook could technically work but is not the 'configure' approach asked for — it introduces operational complexity and polling latency versus native autoscale. — CPU percentage measures compute utilization on the VMs themselves, not the backlog in the queue; if queue depth grows but processors are idle (e.g., workers waiting on I/O), CPU-based scaling would not trigger scale-out.