AZ-400: Designing and Implementing Microsoft DevOps Solutions

Design and Implement Pipelines

Introduction Designing and Implementing Pipelines

In this guide, you’ll learn how to design, build, and manage CI/CD pipelines using Azure DevOps. Whether you’re preparing for the AZ-400 certification or optimizing your team’s delivery process, mastering Azure Pipelines is essential for scalable, automated deployments.

What You’ll Learn

  • Azure Pipelines Fundamentals: Core concepts, terminology, and architecture
  • First Pipeline Setup: Connect repositories, choose pipeline types, and define build steps
  • Automated Deployments: Multi-stage YAML or classic release pipelines with approvals
  • Scalable Pipeline Design: Template reuse, parallel jobs, and agent autoscaling
  • GitHub Integration: Service connections, webhooks, and combining GitHub Actions
  • End-to-End Workflow: From code push to production monitoring
  • Cost, Tools & Licensing: Estimating hosted vs. self-hosted agent costs and license tiers
  • Triggers & Parallel Builds: Push, PR, scheduled triggers, and multi-job parallelism

1. Azure Pipelines Overview

Azure Pipelines provides a cloud-based CI/CD service that works with any language, platform, and cloud provider. You can choose between:

Pipeline TypeDefinition MethodBest For
YAML Pipelinesazure-pipelines.yml in repoVersion-controlled, Infrastructure as Code
Classic PipelinesVisual designer in Azure DevOps portalQuick setup, GUI-based editing

Note

YAML pipelines enable repeatable, code-reviewed pipeline definitions stored alongside your application code.
Classic pipelines suit teams new to DevOps who prefer a drag-and-drop interface.


2. Setting Up Your First Pipeline

  1. Connect to a Repository
    Link Azure DevOps to Azure Repos or GitHub via Service Connections.
  2. Select Pipeline Type
    • YAML: add azure-pipelines.yml at the repo root
    • Classic: configure steps in the Azure DevOps UI
  3. Choose an Agent Pool
    Decide between Microsoft-hosted or self-hosted pools.
  4. Define Build Tasks
    Install dependencies, run tests, and publish artifacts.

Example azure-pipelines.yml:

trigger:
  branches:
    include:
      - main

pool:
  vmImage: 'ubuntu-latest'

steps:
  - task: UsePythonVersion@0
    inputs:
      versionSpec: '3.x'

  - script: |
      pip install -r requirements.txt
      pytest
    displayName: 'Install dependencies & run tests'

3. Automating Deployments

  • Classic Release Pipelines or Multi-Stage YAML
    Define explicit stages (Dev → QA → Production) with artifact sharing.
  • Approvals & Checks
    Use branch policies, manual approvals, or Azure Policy gates to enforce compliance.

4. Designing Scalable Pipelines

StrategyDescription
Template ReuseCentralize common steps using YAML templates
Parallel JobsRun multiple tests or builds simultaneously
Agent AutoscalingScale self-hosted agents with Kubernetes or VM scale sets

5. Integrating GitHub

  • GitHub Actions & Azure Pipelines
    Trigger Azure Pipelines from Actions workflows or vice versa.
  • Service Connections
    Securely authenticate Azure DevOps to GitHub organizations.
  • Webhooks & Status Checks
    Enforce branch policies and display build status in PRs.

6. End-to-End DevOps Workflow

  1. Code Push to Azure Repos or GitHub
  2. Continuous Integration: build, test, and publish artifacts
  3. Continuous Delivery: deploy to staging and production environments
  4. Monitoring & Feedback: integrate with Azure Monitor and Application Insights

7. Cost Estimation, Tools & Licensing

Agent TypeCost ModelNotes
Microsoft-HostedFree minutes per month; overages billedIdeal for small teams; pay-as-you-go scaling
Self-HostedNo per-job cost; host management requiredControl VM specs and network environment
LicensingBasic or higher access requiredAdditional parallel jobs depend on license tier

Warning

Exceeding free tier limits on hosted agents will incur additional charges. Monitor usage in the Azure DevOps Portal.


8. Triggers, Agent Pools & Parallel Builds

Triggers

  • trigger for branch-based CI
  • pr for pull request validation
  • schedules for nightly or periodic runs

Agent Pools

  • Shared pools vs. dedicated pools
  • Microsoft-hosted vs. self-hosted

Parallel Jobs Example

jobs:
- job: Build
  pool:
    vmImage: 'ubuntu-latest'
  steps:
    - script: echo Building...

- job: Test
  dependsOn: Build
  pool:
    vmImage: 'ubuntu-latest'
  steps:
    - script: echo Testing...

References

Watch Video

Watch video content

Previous
Summary