Describe Azure Pipelines and YAML
YAML pipelines represent the "infrastructure as code" approach for CI/CD. Instead of clicking through a visual interface, you define your entire pipeline in a YAML file stored with your source code.
Why use YAML?
Modern microservice architectures often need many similar deployment pipelines. Creating these manually through a UI becomes tedious and error-prone. YAML enables:
- Code reuse: Share pipeline templates across projects
- Version control: Pipeline changes follow the same review process as code
- Consistency: Identical setups across multiple services
- Collaboration: Team members can contribute pipeline improvements
How YAML pipelines work
- Create YAML file: Define your pipeline in
azure-pipelines.ymlin your repository - Connect repository: Link Azure Pipelines to your Git repository
- Push changes: Code and pipeline changes trigger builds automatically
- Monitor results: Track build and deployment progress
YAML pipeline benefits
Version control integration:
- Pipeline definitions live alongside your code
- Changes follow the same branching strategy as your application
- Pull request reviews include both code and pipeline changes
Branch flexibility:
- Each branch can customize its build process
- Feature branches can test pipeline changes safely
- Merge conflicts help identify pipeline incompatibilities
Better troubleshooting:
- Pipeline changes are tracked in version history
- Easier to identify when pipeline modifications cause issues
- Rollback pipeline changes like any other code change
Enhanced security:
- Pipeline configurations are reviewed like code
- Branch policies protect production pipeline definitions
- Approvals and checks provide additional safety layers
Getting started
YAML has a steeper learning curve but offers more power and flexibility. Microsoft now recommends YAML for new pipelines due to its modern DevOps benefits and active feature development.