What you will learn in this TP
- Write a multi-stage pipeline
- Factor deployment into a parameterized template
- Use a variable group
- Require approval on an environment
All steps and instructions are shown. Recommended for this lab: autonomous
Introduction #
Context. The shop must be deployed automatically to staging, and to production only after the manager validates, with a single deployment definition.
Prerequisites: a free Azure DevOps organization, the Azure CLI (azure-devops extension), Git and Python 3, the Lab 2 agent and project · Estimated time: 50 min
A Build → Staging → Production pipeline, a template reused twice and an approval required by the production environment.Setup #
Guided steps, with their solution.
1. Create the variable group
Why? A variable group shares values common to several pipelines, in one place.
Create theboutique-commungroup with anEQUIPEvariable and authorize it for all pipelines in the project.2. Write the multi-stage pipeline
Why? A single template guarantees staging and production are deployed the same way.
Createtemplates/deploy.ymland replaceazure-pipelines.ymlwith a Build → Staging → Production pipeline using the template twice.3. Require approval
Why? Approval is held by the environment: editing the YAML cannot bypass it.
Create therecetteandproductionenvironments (Pipelines › Environments), add an Approvals check toproduction, then push and approve the deployment.4. Clean up
Why? A forgotten agent keeps access to your organization and your machine.
Stop the containers, unregister the agent and revoke the PAT.
Validate your work
Check that each goal above is reached and that you get the result described in the introduction.
Difficulty level : ●●●●○ (4/5)
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
Deploying with Azure Pipelines: environments, approvals and service connections
Delivering with Azure Pipelines: multi-stage pipelines, environments, approvals and checks, deplo...
Azure DevOps security, governance and best practices
Running Azure DevOps securely: permissions and groups, protected resources, pipeline authorizatio...
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...
Building and delivering with GitLab: registry, environments and deployments
Delivering with GitLab CI/CD: building and publishing images to the project registry, package reg...
End-to-end CI/CD (1/5): principles and anatomy of a pipeline
Understand end-to-end CI/CD: continuous integration, continuous delivery and continuous deploymen...
Containers, Kubernetes and cloud native in a DevOps approach
The role of containers and Kubernetes in DevOps: reproducible images, multi-stage Dockerfiles, re...
Terraform multi-environment, workspaces and repository organization
Organize Terraform for several environments: one folder per environment, tfvars files, CLI worksp...
Vagrant best practices: reproducible and fast environments
Vagrant best practices: versioned Vagrantfile, pinned boxes, idempotent provisioning, multi-machi...