RousselTMLEARNING

Article · Azure DevOps: from discovery to expertise

YAML pipelines

1. A continuous integration pipeline #

azure-pipelines.yml.

The file #

YAML structure
trigger:
  branches:
    include: [main]
pr:
  branches:
    include: [main]

pool:
  name: Default            # self-hosted agent; or vmImage: ubuntu-latest

steps:
  - script: |
      python3 -m venv .venv
      .venv/bin/pip install -r requirements-dev.txt
      .venv/bin/pytest --junitxml=$(Build.ArtifactStagingDirectory)/rapport.xml
    displayName: Tests
  - task: PublishTestResults@2
    condition: succeededOrFailed()
    inputs:
      testResultsFiles: $(Build.ArtifactStagingDirectory)/rapport.xml
      testRunTitle: Shop tests
  - task: PublishPipelineArtifact@1
    inputs:
      targetPath: $(Build.SourcesDirectory)
      artifact: boutique
  • Tasks (PublishTestResults@2) are ready-made actions, versioned by their major number.
  • Predefined variables ($(Build.BuildId), $(Build.SourceBranchName), $(Build.ArtifactStagingDirectory)) describe the run.

2. Variables, expressions and templates #

Parameterize and factor.

Three syntaxes #

SyntaxEvaluatedUse
${{ variables.x }}when the YAML is compiledparameters, structural conditions, templates
$[ variables.x ]at runtime, before the jobconditions and computed variables
$(x)at runtime, in the taskvalues in scripts and task inputs
# templates/deploy.yml
parameters:
  - name: environment
    type: string
  - name: port
    type: number
jobs:
  - deployment: deploy_${{ parameters.environment }}
    environment: ${{ parameters.environment }}
    strategy:
      runOnce:
        deploy:
          steps:
            - script: ./deploy.sh ${{ parameters.environment }} ${{ parameters.port }}

# azure-pipelines.yml
variables:
  - group: shop-common              # variable group (Library)
stages:
  - stage: Staging
    jobs:
      - template: templates/deploy.yml
        parameters: { environment: staging, port: 8081 }
  • Variable groups (Pipelines › Library) share values across pipelines, optionally linked to Azure Key Vault.
  • extends enforces an approved pipeline template: a "required template" check rejects pipelines that do not use it.
Watch out : A secret variable is never passed automatically to scripts: pass it explicitly through env:.

Commands to know #

Commands to know
  • az pipelines create --name boutique-ci --yml-path azure-pipelines.yml : create a pipeline
  • az pipelines run --name boutique-ci : run a pipeline
  • az pipelines variable-group create --name boutique-commun --variables REGISTRE=… : create a variable group
  • az pipelines runs list --top 5 -o table : latest runs

Sources #

Checked in November 2026: CI/CD platforms change every month, check versions and plans in the vendor's documentation.

📄 Azure YAML pipelines: stages, tasks, variables and templates →

My progress

  • ⏱ Estimated time : ≈ 8 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

End-to-end CI/CD (3/5): artifacts, registries and environments

Deliver continuously: immutable, versioned artifacts, image and package registries, promoting the...

OpenTelemetry Collector, Grafana Alloy and Bindplane: comparing three approaches to telemetry pipelines

Detailed comparison of three ways to manage telemetry pipelines: the OpenTelemetry Collector in Y...

Terraform in CI/CD: pipelines, plan review, OIDC and GitOps

Automate Terraform: plan pipeline on merge requests and apply after approval, posting the plan as...

Configuration as Code with Monaco: tokens, OAuth, projects and CI/CD

Manage Dynatrace configuration as code with Monaco: API tokens and OAuth clients, manifest, proje...

Pipelines and functions: parse, enrich, mask

Building Cribl Stream pipelines: pre-processing, processing and post-processing, the function cat...

Logs in Datadog: collection, pipelines, indexes and volume control

Collect logs with the agent, structure them with pipelines and processors (grok), use facets and ...

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

GitHub Actions: concepts and how it works

Discover GitHub Actions: events, workflows, jobs, steps and actions, the Marketplace, hosted runn...

Installing the Datadog agent and configuring integrations

Install the Datadog agent on Linux, Docker and Kubernetes (Datadog Operator), understand datadog....

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!