Skip to content
Back to Blog
1 min read

Azure DevOps Environments and Deployments

Configuring Environments

# Pipeline with environment deployments
trigger: [main]

stages:
  - stage: DeployDev
    jobs:
      - deployment: DeployToDev
        environment: 'development'
        strategy:
          runOnce:
            deploy:
              steps:
                - script: echo "Deploying to dev"

  - stage: DeployStaging
    dependsOn: DeployDev
    jobs:
      - deployment: DeployToStaging
        environment: 'staging'
        strategy:
          runOnce:
            deploy:
              steps:
                - script: echo "Deploying to staging"

  - stage: DeployProd
    dependsOn: DeployStaging
    jobs:
      - deployment: DeployToProduction
        environment: 'production'
        strategy:
          canary:
            increments: [10, 50, 100]
            deploy:
              steps:
                - script: echo "Deploying ${{ strategy.name }}"
            on:
              failure:
                steps:
                  - script: echo "Rolling back"

Environment Configuration

  • Approvals and checks
  • Deployment history tracking
  • Resource targeting (Kubernetes, VMs)
  • Exclusive locks
  • Business hours restrictions

Environments provide governance and visibility for deployments across your infrastructure.

Michael John Peña

Michael John Peña

Data & AI Director and Microsoft MVP based in Sydney. Writing about Microsoft Fabric, Azure, data engineering, and AI.