Skip to main content

WebAPI Build & Canary Pipeline

Build Status

View pipeline in Azure DevOps

Purpose

  • Builds and deploys the Publix.S0PMOBAI.WebAPI service via a reusable canary template.
  • Promotes a single .NET artifact through Dev → Test → Stage → Prod while supporting multi-region rollout.

Resources

  • Imports templates/appservices/canary-deployment.yml from the shared S0AIDXXX-AI Delivery/s0aidxxx-templates repository (tag v1.0.1).
  • Also references Publix DevOps templates (publix-devops/SelfServiceDeployments-Templates tag v6) for shared deployment logic.

Triggers

  • Branches: main, any releases/* branch.
  • Paths: src/services/Publix.S0PMOBAI/src/** (excluding the Function App subtree).
  • Lower environments are conditionally skipped for release branches inside each stage using not(startsWith(variables['Build.SourceBranch'], 'refs/heads/releases/')).

Agent Pool

  • Executes on ubuntu-latest-publix.

Stage Overview

  • Single stage driven by the shared template with key parameters:
    • buildType: dotnet for multi-target .csproj builds.
    • buildPath: **/Publix.S0PMOBAI.WebAPI.csproj (glob resolved by template).
    • buildConfiguration: Release.
    • artifactName: Publix.S0PMOBAI.WebAPI.
    • appShortName: pmobchat.
    • appType: apap (App Service API).
    • useSlots: enabled for production deployments to support slot swaps.
  • Template handles restore/build, artifact publish, canary deployment, health validation, and promotion between slots/regions.

Environment Matrix

  • Each entry supplies the Azure connection, DevOps environment, deployment regions, and release gating behavior.
EnvService ConnectionADO EnvironmentConditionRegionsNotes
Devs0pmobai-01-devDEV_S0PMOBAISkipped on release branchesuc, utStandard canary rollout
Tsts0pmobai-01-tstDEV_S0PMOBAISkipped on release branchesuc, utMirrors Dev path
Stgs0pmobai-01-stgDEV_S0PMOBAISkipped on release branchesuc, utPre-prod validation
Prds0pmobai-01-prdPRD_S0PMOBAIAlways activeuc, utuseSlots: true for blue/green swap

Add the ut region to the YAML once infrastructure is ready; template supports multiple regions per environment.

Release Branch Behavior

  • Dev/Test/Stage stages are wrapped with not(startsWith(..., 'refs/heads/releases/')), preventing release branches from redeploying lower environments.
  • Production stage lacks the guard so release branches can deploy directly to prod after validation.

Maintenance Notes

  • Update template tags deliberately; new versions may change required parameters or behavior.
  • Keep region lists in sync with available App Service deployments (uc and ut expected).
  • For additional configuration (e.g., custom variables, slot settings), extend environmentObjects in the YAML or adjust the shared template as needed.
  • Secrets and connection strings should be managed via Azure DevOps variable groups or Key Vault references consumed by the template.