You are deploying a backend worker service as an Azure Container App named `order-processor`. The app needs to process messages from an Azure Service Bus queue named `orders` and scale dynamically between and replicas based on the queue depth. You are configuring this deployment using a Bicep template.
Which two of the following configurations must you define in the Bicep template to meet these scaling requirements? (Select two.)
- Define the `minReplicas` and `maxReplicas` properties within the `scale` block under the `template` section of the Container App resource properties.Cevap
- Add a scaling rule to the `rules` array under the `scale` block, defining a `custom` rule type with the `type` property set to `'azure-servicebus'`.Cevap
- CAdd a scaling rule to the `rules` array under the `scale` block, defining an `azureQueue` rule type with the `queueName` property set to `'orders'`.
- DConfigure the scaling rule `auth` parameters to authenticate via a user-assigned managed identity while the Container App's `identity.type` is set to `'SystemAssigned'` only.
Cevap
To configure scaling based on an Azure Service Bus queue, you must define the minimum and maximum replicas inside the template's scale block, and define a custom scaling rule inside the rules array with the type set to 'azure-servicebus'.
Defining the replication boundaries within the scale block under the template property sets the minimum and maximum limits. Since there is no dedicated Service Bus schema element, using a custom rule with the type set to 'azure-servicebus' correctly instructs the underlying KEDA engine to connect to and monitor the Service Bus queue.
Adım Adım Çözüm
Anahtar Kavram
Configuring KEDA-based custom autoscaling rules in Azure Container Apps Bicep templates.