RousselTMLEARNING

TP · Azure DevOps: from discovery to expertise

Lab: Multi-stage pipeline, environments and approval

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
Mode :

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. 1. Create the variable group

    Why? A variable group shares values common to several pipelines, in one place.

    Create the boutique-commun group with an EQUIPE variable and authorize it for all pipelines in the project.
  2. 2. Write the multi-stage pipeline

    Why? A single template guarantees staging and production are deployed the same way.

    Create templates/deploy.yml and replace azure-pipelines.yml with a Build → Staging → Production pipeline using the template twice.
  3. 3. Require approval

    Why? Approval is held by the environment: editing the YAML cannot bypass it.

    Create the recette and production environments (Pipelines › Environments), add an Approvals check to production, then push and approve the deployment.
  4. 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

  • ⏱ Estimated time : ≈ 50 min

Sign in to track your progress and take notes. Sign in

⭐ Rate this lesson

5.0 initial rating from the teaching team

Sign in to rate this lesson →

💬 Questions about this lesson

No questions yet: be the first to ask for help or share your configuration.

Ask a question about this lesson →

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...

Support us

♥ SUPPORT US

Support RousselTM Learning

Courses, articles, labs and certificates stay free with no intrusive ads. A voluntary contribution, of any amount you choose, pays for hosting, lab environments and new content.

Contribute with PayPal Any amount · card or PayPal accountLearn more
QR code PayPal
Or scan this QR code with your phone

Thank you, every contribution counts!