Soru

Zorluk: OrtaDeploy and Configure Azure Container Apps

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 11 and 1010 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.)

  1. Define the `minReplicas` and `maxReplicas` properties within the `scale` block under the `template` section of the Container App resource properties.Cevap
  2. 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
  3. C
    Add a scaling rule to the `rules` array under the `scale` block, defining an `azureQueue` rule type with the `queueName` property set to `'orders'`.
  4. D
    Configure 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

1
Set scaling limits inside the Bicep template.
Define `properties.template.scale.minReplicas` as 11 and `properties.template.scale.maxReplicas` as 1010.
This establishes the minimum and maximum scaling boundaries for the container instances.
2
Configure the scaling trigger type.
Create an entry in the `properties.template.scale.rules` array containing a `custom` object where `type` is set to `'azure-servicebus'`. Provide the queue name and trigger threshold within the `metadata` object.
Azure Container Apps scales using KEDA. While Azure Storage Queues have a dedicated `azureQueue` helper block, Azure Service Bus requires using the generic `custom` block targeting the `'azure-servicebus'` KEDA scaler.

Anahtar Kavram

Configuring KEDA-based custom autoscaling rules in Azure Container Apps Bicep templates.
Bu soruyu puanla