2 min read
Azure DevOps Best Practices - October 2022 Summary
This post summarizes best practices for Azure DevOps based on the features and improvements we have covered throughout October 2022.
Pipeline Best Practices
# Well-structured pipeline
trigger:
branches:
include: [main, release/*]
paths:
exclude: ['docs/**', '*.md']
pr:
branches:
include: [main]
autoCancel: true
variables:
- group: 'common-variables'
- template: variables/production.yml
stages:
- template: stages/build.yml
parameters:
buildConfiguration: 'Release'
- template: stages/test.yml
parameters:
testProjects: '**/*Tests.csproj'
- template: stages/deploy.yml
parameters:
environment: 'production'
Security Best Practices
- Use service connections - Avoid storing credentials in pipelines
- Link to Key Vault - Centralize secret management
- Enable branch policies - Require reviews and builds
- Use environments - Implement approval workflows
- Audit regularly - Review access and permissions
Performance Best Practices
- Cache dependencies - Reduce restore times
- Use pipeline artifacts - Share between jobs efficiently
- Right-size agents - Match workload to resources
- Parallelize tests - Speed up test execution
- Template reuse - Maintain consistency and reduce duplication
Governance Best Practices
- Environment approvals - Gate production deployments
- Deployment gates - Automate quality checks
- Secure files - Protect certificates and keys
- Variable groups - Centralize configuration
- Agent pools - Organize and manage compute resources
Azure DevOps provides a comprehensive platform for enterprise DevOps with robust security and governance features.