What is Azure Pipelines?
Azure Pipelines is a cloud service that you can use to automatically build and test your code projects and make them available to users. It works with any language, platform, or cloud, and integrates with GitHub, Azure Repos, Bitbucket, and many others.
Key Features
- CI/CD for any language (Node.js, Python, .NET, Java, and more)
- Hosted Microsoft-hosted agents or self-hosted agents
- Parallel jobs, multi-stage pipelines, and YAML configuration
- Built-in support for containers and Kubernetes
Getting Started – A Simple YAML Pipeline
Create a file named azure-pipelines.yml at the root of your repository:
trigger:
- main
pool:
vmImage: 'ubuntu-latest'
steps:
- task: UseNode@2
inputs:
version: '18.x'
- script: |
npm install
npm run build
displayName: 'Install and Build'
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: 'dist'
ArtifactName: 'drop'
Run the Pipeline
- Push the YAML file to your repo.
- Navigate to Azure DevOps → Pipelines → New Pipeline.
- Select your repository and let Azure detect the
azure-pipelines.ymlfile. - Run the pipeline and watch the logs in real time.
Advanced: Multi‑Stage Pipelines
Define separate stages for build, test, and release:
trigger:
- main
stages:
- stage: Build
jobs:
- job: BuildJob
pool:
vmImage: 'ubuntu-latest'
steps:
- script: npm install
displayName: 'Install dependencies'
- script: npm run build
displayName: 'Build app'
- publish: $(Build.ArtifactStagingDirectory)
artifact: drop
- stage: Test
dependsOn: Build
jobs:
- job: TestJob
pool:
vmImage: 'ubuntu-latest'
steps:
- download: current
artifact: drop
- script: npm test
displayName: 'Run tests'
- stage: Deploy
dependsOn: Test
condition: succeeded()
jobs:
- deployment: DeployJob
environment: 'Production'
pool:
vmImage: 'ubuntu-latest'
strategy:
runOnce:
deploy:
steps:
- download: current
artifact: drop
- script: echo 'Deploying to production...'
displayName: 'Deploy'