Question

Difficulty: MediumDeploy and Configure Azure Container Apps

You are configuring a canary deployment for an Azure Container App named `web-shop`. The application is configured to run multiple active revisions. You have deployed a new revision named `web-shop--v2`, and the existing revision is named `web-shop--v1`.

You need to configure the HTTP ingress of the Container App to route 80%80\% of the incoming traffic to `web-shop--v1` and the remaining 20%20\% to `web-shop--v2`.

Which configuration block should you include under the `properties.configuration.ingress` section of the Container App Bicep template?

  1. traffic: [
    {
    revisionName: 'web-shop--v1'
    weight: 80
    }
    {
    revisionName: 'web-shop--v2'
    weight: 20
    }
    ]
    Answer
  2. B
    traffic: [
    {
    revision: 'web-shop--v1'
    percent: 80
    }
    {
    revision: 'web-shop--v2'
    percent: 20
    }
    ]
  3. C
    traffic: [
    {
    revisionName: 'web-shop--v1'
    weight: '80%'
    }
    {
    revisionName: 'web-shop--v2'
    weight: '20%'
    }
    ]
  4. D
    identity: {
    type: 'SystemAssigned'
    }
    traffic: [
    {
    revisionName: 'web-shop--v1'
    weight: 80
    }
    {
    revisionName: 'web-shop--v2'
    weight: 20
    }
    ]

Answer

The correct block must define the 'traffic' array with objects specifying 'revisionName' as 'web-shop--v1' and 'web-shop--v2', and 'weight' as the integers 80 and 20 respectively.
The correct configuration uses the 'traffic' block under 'properties.configuration.ingress'. In this block, you specify the active revisions using the 'revisionName' property and allocate the traffic share as an integer percentage using the 'weight' property. This allows the Container App to balance traffic according to the specified weights.

Step-by-Step Solution

1
Locate the 'ingress' property under 'properties.configuration' in the Container App template.
Confirm where traffic routing rules are defined.
Traffic splitting is configured at the ingress level of the application.
2
Add the 'traffic' array containing an entry for each active revision.
Ensure both 'web-shop--v1' and 'web-shop--v2' are targeted.
To split traffic, each target revision must have a defined entry in the array.
3
Use the 'revisionName' property to specify the revision and the 'weight' property with an integer value to define the traffic share.
Assign a weight of 80 to the first revision and 20 to the second revision.
The weight must be an integer, and the property names must strictly match the Azure resource provider specification.

Key Concept

Configuring traffic splitting for multiple revisions in Azure Container Apps ingress.
Rate this question