For the complete documentation index, see llms.txt. This page is also available as Markdown.

Azure Container Apps Traffic Shift

Traffic shift step for Azure Container Apps.

The Azure Container Apps Traffic Shift step manages progressive traffic distribution from old revisions to new revisions, enabling safe Canary deployments with gradual rollout.

PREREQUISITES

  • This step must be added within a Container Step Group. The step runs as a containerized task and requires the container infrastructure configuration provided by the step group.

  • A Download Manifests step must be added before this step to fetch the required manifest files.

  • An Azure Container Apps Deploy step must execute before this step to create the new revision.

What this step does

The Azure Container Apps Traffic Shift step performs the following operations:

  1. Parses inputs: Reads the manifest and traffic configuration to determine target revisions and traffic weights

  2. Activates required revisions: Ensures all revisions that should receive traffic are active and sets the active revisions mode to Multiple if needed

  3. Applies traffic shift: Updates the Azure Container App traffic configuration to distribute traffic according to specified weights

  4. Finalizes outputs: Waits for the deployment to stabilize and outputs current revision status and traffic distribution

This step enables progressive traffic shifting by allowing you to control exactly how traffic is distributed across revisions. You can add multiple traffic shift steps to gradually increase traffic to the new revision while monitoring application health and performance.

Deployment phases

The step executes in four phases:

Phase 1: Parsing inputs

Harness reads the traffic configuration and resolves revision aliases to actual revision names:

  • latest: The most recently created revision

  • secondlatest: The second most recent revision

You can also specify exact revision names instead of using aliases.

Phase 2: Activating required revisions

Harness ensures that all revisions specified in the traffic configuration are active. If multiple revisions need to receive traffic, the step sets the active revisions mode to Multiple (required for traffic splitting in Azure Container Apps).

Phase 3: Applying traffic shift

Harness updates the traffic configuration in Azure Container Apps to match your specified distribution. Traffic is split according to the weights you configured, and optional tags can be assigned to revisions for testing specific versions.

Phase 4: Finalizing outputs

Harness waits for the traffic shift to stabilize (typically 1 minute) and then outputs the current state, including revision status, replica counts, traffic distribution, and instance details.

Step parameters

Revision Traffic Details

This section defines how traffic should be distributed across revisions. You can add multiple entries to split traffic between different revisions.

Parameter
Description
Required

Revision Name

The name of the revision that should receive traffic. Use latest for the most recent revision, secondlatest for the second most recent, or specify an exact revision name.

Yes

Traffic Value

The percentage of traffic this revision should receive (0-100). The sum of all traffic values must equal 100.

Yes

Tag (optional)

A tag assigned to this revision for testing. You can use tags to route requests to specific revisions for testing purposes via revision-specific URLs.

No

Additional Parameters

Parameter
Description
Required

Name

Display name for the step

No

Timeout

Maximum time allowed for the step to complete (default: 30m)

No

Skip Traffic Shift

When enabled, the step skips traffic shifting. Typically left disabled (false) for standard Canary deployments.

No

Container configuration

Parameter
Description

Container Registry

Harness connector for authenticating to your container registry. This connector pulls the deployment plugin image.

Image

The deployment plugin container image. Use the official Harness image: harness/azure-container-apps-plugin:0.0.1-linux-amd64

Image Pull Policy

Policy for pulling the container image (default: Always)

Resources

Resource limits for the container (e.g., 512Mi memory, 0.5 CPU)

Revision aliases

To make traffic shifting easier and more maintainable, you can use revision aliases instead of hardcoding revision names:

  • latest: References the most recently created revision (typically the new version you just deployed)

  • secondlatest: References the second most recent revision (typically the previous version)

These aliases are resolved dynamically at runtime, so your pipeline configuration remains valid across multiple deployments without requiring updates.

Example usage:

Progressive traffic shifting

For safe Canary deployments, you should add multiple traffic shift steps with increasing traffic percentages. This enables you to validate the new revision at each traffic level before increasing exposure.

Example phased rollout:

  1. Traffic Shift 1: 20% to latest (new), 80% to secondlatest (old)

    • Initial validation with minimal risk

    • Monitor error rates and performance metrics

  2. Traffic Shift 2: 70% to latest, 30% to secondlatest

    • Increase exposure after validation

    • Continue monitoring application health

  3. Traffic Shift 3: 100% to latest

    • Full cutover to the new revision

    • Old revision can be deactivated

Between each traffic shift step, you can add:

  • Manual approval steps for controlled progression

  • Verification steps to check application metrics

  • Custom scripts to validate specific functionality

  • Wait steps to allow metrics to stabilize

Example log output

Traffic Shift Step 1 (20% / 80%)

Traffic Shift Step 2 (70% / 30%)

Usage in pipeline

The Azure Container Apps Traffic Shift step should be placed after the Deploy step in your deployment step group. You can add multiple traffic shift steps to create a progressive rollout.

YAML Example

Single Traffic Shift (100%)

Progressive Traffic Shift (20% / 80%)

Last updated

Was this helpful?