← Back to Cards

YAML Pipeline Structure

triggerbranches, paths, tags — defines when pipeline runs
poolvmImage: 'ubuntu-latest' or self-hosted agent pool
stagesLogical grouping: Build, Test, Deploy
jobsRun on an agent, contain steps; can depend on other jobs
stepstask, script, bash, powershell, checkout
variablesInline, variable groups, template expressions

Common Pipeline Tasks

UseDotNet@2Install a specific .NET SDK version
Npm@1npm install, build, test, publish
AzureCLI@2Run Azure CLI commands with service connection auth
AzureRmWebAppDeployment@4Deploy to Azure App Service
TerraformTaskV4@4Terraform init, plan, apply, destroy
PublishBuildArtifacts@1Publish artifacts for downstream stages

Pipeline Best Practices

TemplatesUse extends and template references to reuse pipeline logic
EnvironmentsDefine environments with approval gates and checks
Service ConnectionsUse Workload Identity Federation for passwordless auth
CachingCache@2 task for node_modules, NuGet, pip to speed builds
SecretsStore in Variable Groups linked to Azure Key Vault
Multi-stageSeparate Build, Test, Deploy stages with dependencies