Back to Blog
1 min read

Deployment Gates in Azure DevOps

Deployment gates in Azure DevOps enable automated quality checks before and after deployments. This post covers implementing gates for safer deployments.

Gate Types

# Pipeline with deployment gates
stages:
  - stage: Deploy
    jobs:
      - deployment: DeployToProduction
        environment: 'production'
        strategy:
          runOnce:
            preDeploy:
              steps:
                - script: echo "Pre-deployment checks"
            deploy:
              steps:
                - task: AzureWebApp@1
                  inputs:
                    azureSubscription: 'Connection'
                    appName: 'myapp'
            routeTraffic:
              steps:
                - script: echo "Routing traffic"
            postRouteTraffic:
              steps:
                - script: echo "Post-routing validation"
            on:
              failure:
                steps:
                  - script: echo "Deployment failed"
              success:
                steps:
                  - script: echo "Deployment successful"

Common Gates

  • Azure Monitor alerts check
  • Work item query validation
  • REST API invocation
  • Azure Policy compliance
  • Security scan validation

Gates automate quality assurance in your deployment pipelines.

Michael John Peña

Michael John Peña

Senior Data Engineer based in Sydney. Writing about data, cloud, and technology.