Skip to content

Azure DevOps Release Pipeline Handles Offline Deployment Group Machines without Failure

Scenario Overview:

In an existing CI/CD setup with Azure DevOps, we encounter challenges when deploying to a deployment group that includes some machines scheduled offline during certain hours. The release pipeline fails if it detects at least one machine is not online because the current configuration lacks provisions for handling partial availability of target environments effectively.

Target Machine Deployment Configuration:

Objective:

To modify our Azure DevOps Release Pipeline so that deployment can occur on all online machines within a group without being obstructed by those scheduled as offline—essentially, ignoring the status of unavailable targets during release execution.


Solution Approach for Partially Available Deployment Group:

  1. Tagging Strategy - Classify each target machine with tags that denote their availability state (e.g., Active, Offline). Tags help in filtering out the machines according to current operational status without additional scripts or manual intervention within pipeline tasks. Here’s how you can apply this strategy:
    stages:
      - stage: Deploy Online Targets
        jobs:
          - deployment job: AzureDeploymentJob
            environment: 'ProductionEnvironmentTaggedWithActiveMachineTagsHereForExamplesOnly'
            pool: $(deploymentPoolName) # Pool containing only online machines with tags like Active=true
    
  2. Stage Filtering Based on Tags - In the Release Pipeline, add conditions that ensure deployment stages run exclusively for targets tagged as ‘Active.’ This way, when a machine goes offline and its status changes to inactive or untaged (due to manual intervention), it will not disrupt subsequent pipeline execution.
      - stage: Deploy To All Online Machines Including Offsite Targets With Tags Filtering
        condition: startsWith(variables['Revision'], 'OnlineMachines') # This conditional ensures this stage runs for machines with the Active tag only, even if there are some offline ones in your group.
    
  3. No Manual Overrides - Implement these configurations so that no manual overrides or complex scripts (like custom PowerShell) within tasks of pipeline stages interf_stop further execution; this keeps things seamless for users and the system alike, allowing uninterrupted deployments to proceed based solely on machine availability as indicated by their tags.

Benefits:

By using a tagging strategy alongside conditional stage filtering within Azure DevOps Release Pipeline configurations, we establish an efficient process where deployment is not influenced negatively even if part of the group goes offline simultaneously—optimizing both system resources and developer focus on continuous integration processes without extra complexity.


Previous Post
Nginx as a Webserver Outside an Ingress Controller
Next Post
Why Is Traefik Installed During a New K3S Install