1. Multi-stage pipelines #
Build, staging, production.
The pipeline #
stages:
- stage: Build
jobs:
- job: image
steps:
- task: Docker@2
inputs:
containerRegistry: acr-boutique
repository: boutique
command: buildAndPush
tags: $(Build.BuildId)
- stage: Production
dependsOn: Build
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main'))
jobs:
- deployment: web
environment: production
strategy:
runOnce:
deploy:
steps:
- task: AzureWebAppContainer@1
inputs:
azureSubscription: azure-production
appName: boutique-prod
containers: monacr.azurecr.io/boutique:$(Build.BuildId)- A deployment job records history in the environment and offers the
runOnce,rolling(virtual machines) andcanary(Kubernetes) strategies. - Classic release pipelines (graphical UI) are legacy: prefer multi-stage YAML, versioned with the code.
2. Environments and connections #
Who can deploy, with which rights.
Checks #
| Check | Effect |
|---|---|
| Approvals | a person or group validates before deployment |
| Business hours | deployments only within a time window |
| Exclusive lock | only one run at a time on the environment |
| REST call or Azure Monitor query | blocks if an alert is active |
| Required template | only pipelines extending the approved template pass |
A service connection gives the pipeline access to Azure, a registry or Kubernetes. Workload identity federation (OIDC) replaces service principal secrets: no more password that expires or leaks.
Best practice : Put approvals on the production environment and service connection, not in the YAML: a developer cannot remove them by editing the pipeline.
Azure Artifacts #
Feeds host npm, NuGet, pip, Maven and universal packages, with cached upstream sources (npmjs, PyPI) and views (prerelease, release) to promote a package.
Commands to know #
Commands to know
az devops service-endpoint list -o table: service connectionsaz artifacts universal publish --feed … --name … --version 1.0.0 --path .: publish a universal packageaz pipelines runs show --id <id>: run details
Sources #
Checked in November 2026: CI/CD platforms change every month, check versions and plans in the vendor's documentation.
My progress
Sign in to track your progress and take notes. Sign in
💬 Questions about this lesson
No questions yet: be the first to ask for help or share your configuration.
Recommended Articles
Azure YAML pipelines: stages, tasks, variables and templates
Writing Azure pipelines in YAML: trigger and pr triggers, stages, jobs and steps, versioned tasks...
Delivering with GitHub Actions: GHCR, environments, OIDC and attestations
Building and deploying with GitHub Actions: publishing an image to GitHub Container Registry with...
End-to-end CI/CD (3/5): artifacts, registries and environments
Deliver continuously: immutable, versioned artifacts, image and package registries, promoting the...
Azure Pipelines agents: hosted, self-hosted and managed pools
Choosing and running Azure Pipelines agents: Microsoft-hosted agents and images, self-hosted agen...
Azure DevOps: services, organization and plans
Discover Azure DevOps: Boards, Repos, Pipelines, Test Plans and Artifacts, organizations and proj...
Reusing and securing GitLab pipelines
Industrializing GitLab CI/CD: extends, anchors and !reference, include, CI/CD components and cata...
Azure Boards and Azure Repos: planning and collaborating
Organizing work with Azure Boards (Agile, Scrum, Basic and CMMI processes, work items, backlogs, ...
Azure DevOps security, governance and best practices
Running Azure DevOps securely: permissions and groups, protected resources, pipeline authorizatio...
Building and delivering with GitLab: registry, environments and deployments
Delivering with GitLab CI/CD: building and publishing images to the project registry, package reg...