Exploring Deployment Jobs strategies in Azure DevOps multi-stage YAML – Rolling Deployment
A Rolling Deployment strategy in Azure DevOps involves deploying updates incrementally to one environment at a time, moving from lower environments to higher environments (e.g., Development → Staging → Production).
This allows for gradual validation and testing before the changes are fully deployed.
Key Concepts of Rolling Deployment
Incremental Deployment: Deploying updates to one environment at a time while ensuring stability in previous environments.
Traffic Shifting: Gradually moving traffic from the old environment to the new environment as updates are deployed.
Progressive Validation: Ensuring that lower environments are stable before proceeding to higher environments.
Example Multi-stage YAML with Rolling Deployment Strategy
xxxxxxxxxx211stages2stageDev3 jobs4jobDeployDev5 steps6scriptecho "Deploying to Development environment..."7scriptecho "Testing in Development..."8stageStaging9 dependsOnDev10 jobs11jobDeployStaging12 steps13scriptecho "Deploying to Staging environment..."14scriptecho "Testing in Staging..."15stageProduction16 dependsOnStaging17 jobs18jobDeployProduction19 steps20scriptecho "Deploying to Production environment..."21scriptecho "Validating in Production..."Details of Rolling Deployment Strategy
Dev Stage:
Deploy updates to the Development environment.
Perform testing to ensure stability.
Staging Stage:
After Dev is stable, move to Staging.
Ensure proper validation and testing in Staging.
Production Stage: Once Staging is validated, deploy to Production with minimal risk.
Steps in Rolling Deployment
Deploy to Development:
Apply updates to the Development environment.
Run unit tests and basic validations.
Deploy to Staging:
After Development is stable, deploy to Staging.
Conduct more comprehensive testing.
Deploy to Production: Finally, deploy updates to Production after ensuring that Development and Staging environments are stable.
Additional Considerations
Traffic Management: Gradually shift traffic from old environments to new ones to minimize impact.
Testing: Conduct extensive testing at each stage to ensure quality.
Rollback: Prepare rollback strategies in case issues arise at any stage.
Notifications: Use notifications at each stage to inform stakeholders about progress and deployment status.
Using Approval Gates in Rolling Deployment
You can combine Rolling Deployment with Approval Gates to ensure manual intervention at key stages.
xxxxxxxxxx291stages2stageDev3 jobs4jobDeployDev5 steps6scriptecho "Deploying to Development..."7scriptecho "Testing Development environment..."8hooks9approval10 nameDev Approval11 conditioneq(variables'Build.Status', 'Succeeded')12stageStaging13 dependsOnDev14 jobs15jobDeployStaging16 steps17scriptecho "Deploying to Staging..."18scriptecho "Testing Staging environment..."19hooks20approval21 nameStaging Approval22 conditioneq(variables'Build.Status', 'Succeeded')23stageProduction24 dependsOnStaging25 jobs26jobDeployProduction27 steps28scriptecho "Deploying to Production..."29scriptecho "Validating Production environment..."Summary
A Rolling Deployment strategy in Azure DevOps helps ensure a gradual and controlled deployment process, minimizing risk and improving overall system stability. Write in comments and let me know if you’d like more details or examples.






















Leave a Reply