WebAPI Build & Canary Pipeline
Purpose
- Builds and deploys the
Publix.S0PMOBAI.WebAPIservice 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.ymlfrom the sharedS0AIDXXX-AI Delivery/s0aidxxx-templatesrepository (tagv1.0.1). - Also references Publix DevOps templates (
publix-devops/SelfServiceDeployments-Templatestagv6) for shared deployment logic.
Triggers
- Branches:
main, anyreleases/*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:dotnetfor 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.
| Env | Service Connection | ADO Environment | Condition | Regions | Notes |
|---|---|---|---|---|---|
| Dev | s0pmobai-01-dev | DEV_S0PMOBAI | Skipped on release branches | uc, ut | Standard canary rollout |
| Tst | s0pmobai-01-tst | DEV_S0PMOBAI | Skipped on release branches | uc, ut | Mirrors Dev path |
| Stg | s0pmobai-01-stg | DEV_S0PMOBAI | Skipped on release branches | uc, ut | Pre-prod validation |
| Prd | s0pmobai-01-prd | PRD_S0PMOBAI | Always active | uc, ut | useSlots: 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 (
ucandutexpected). - For additional configuration (e.g., custom variables, slot settings), extend
environmentObjectsin 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.