Skip to main content

Part 2: CI/CD Pipelines

Runbook Azure GitHub GitLab Azure DevOps

DOCUMENT CATEGORY: Part Overview SCOPE: CI/CD pipeline platform selection and configuration PURPOSE: Help teams choose and implement a supported pipeline platform for Azure Local delivery MASTER REFERENCE: GitLab CI/CD Documentation

Status: Active

Part Purpose​

This part documents the supported delivery pipeline platforms for Azure Local automation. Use it after the CI/CD infrastructure is in place and once your team is ready to codify validation, planning, deployment, and post-deployment operations in a repeatable workflow.

Platform Comparison​

PlatformBest ForAzure Auth ModelApproval Model
GitLab CI/CDTeams standardizing on GitLab and modular stage-based deliveryAZL_AUTH_METHOD: OIDC through the ID token ARM_OIDC_TOKEN (id_tokens, a federated app registration), or the masked ARM_CLIENT_SECRETManual jobs in protected environments
GitHub ActionsTeams standardizing on GitHub repositories and environment rulesAZL_AUTH_METHOD: OIDC (azure/login, no client secret) or ARM_CLIENT_SECRETEnvironment protection rules (required reviewers)
Azure DevOps PipelinesTeams already operating in Azure DevOpsARM service connection: workload identity federation (oidc) or its secret (client_secret)Environment approvals and checks

Every pipeline follows devops.authentication.method through AZL_AUTH_METHOD, and every value a pipeline needs (sign-in, runner, environments, infrastructure file, tool versions, state, job timeouts, schedule) is a key of infrastructure.yml that Task 05 sets on the platform, or writes into the files of the repository where a platform reads a value before any variable exists (the Azure DevOps variables/pipeline-settings.yml and approval-environments.yml, and the cron line of the scheduled check); no pipeline file carries a value of a deployment, and no Azure DevOps run parameter does. A managed identity of the runner is not a sign-in method of the pipelines.

One Design on Every Platform​

The three platforms run one CI/CD design (owner directive D126). Each pipeline is a thin wrapper that calls the same PowerShell entry scripts with the same values, binds the same approval environments and refuses to change anything while one is not set, starts by hand (GitHub workflow_dispatch, GitLab the web form or the API, Azure DevOps trigger: none), and the check for updates runs on the same schedule. No logic of one platform only is left: the GitLab-only Validate Deployment stage is gone, the check of the master file and the second approval of a storage wipe are on all three. The toolkit generates the parity table pipelines/PARITY.md (pipeline by platform: entry scripts, approval environments, refusal, start, schedule) with pipelines/New-PipelineParity.ps1, and a test fails when a row is not Equal. What still differs is syntax only: the lock of one run at a time, the tool installers, where a platform keeps a schedule, and the Azure DevOps settings files.

Pipelines are run last

No pipeline is run on a platform until every script it calls has been proven by hand (owner directive D124). The pipelines are checked by the toolkit's tests, not yet by runs.

Common Pipeline Flow​

The toolkit ships these families of pipeline files for each platform. They are separate pipelines, not one chain.

FamilyStagesCalls
Terraform and Ansible deployvalidate -> plan -> deploy-foundation -> configure-onprem -> configure-operationsTerraform and Ansible playbooks (05, 01, 02, 03, then 04), each job writing its variable files from infrastructure.yml first. It does not deploy the cluster: that is the ARM pipeline
Discovery (before the OS configuration)One read-only job, no approvalInvoke-AzlDiscoveryRun.ps1: the BMC hardware inventory, the Dell iDRAC discovery, the Azure tenant and the Active Directory inventory. See Task 02: Hardware Discovery
OS configuration (Phase 03)Plan (read only), then Apply behind an approvalInvoke-AzureLocalOsConfiguration.ps1. See Automated OS configuration
Pre-cluster verification (the gate before the ARM Validate)A read-only job; a second job for -Fix and -InstallEnvironmentChecker, behind the approval of the ARM deployment environment. Fails when the verdict is not PassInvoke-AzureLocalPreClusterVerification.ps1. See Pre-cluster verification gate
ARM Validate and Deploy (Phase 05)Preconditions, Validate, then Deploy behind an approvalInvoke-AzureLocalArmDeployment.ps1. See ARM Validate and Deploy automation
Validation (Part 7, before the handover)A read-only job; the storage load test as a second job behind the operations approvalThe four validation scripts. See Validation and day 2 pipelines
Day 2 (Part 8)Check for updates (read only, on a schedule); update, node maintenance and cluster operations: a read-only plan, then the change behind the operations approvalThe day 2 scripts. See Validation and day 2 pipelines

Pipelines of the Deployment Route​

One pipeline per piece of the route, in the order a deployment runs them. Each exists once per platform and runs one entry point of the toolkit and nothing else.

PipelineEntry pointGitHub ActionsGitLab CIAzure DevOps
CI/CD infrastructure (the runners)Deploy-CicdRunners.ps1 (Task 06)pipelines/github-actions/cicd-infra.ymlpipelines/gitlab/stages/deploy-cicd-infra.ymlpipelines/azure-devops/cicd-infra.yml
Discovery (BMCs, Azure tenant, Active Directory)scripts/common/discovery/Invoke-AzlDiscoveryRun.ps1pipelines/github-actions/discovery.ymlpipelines/gitlab/stages/discovery.ymlpipelines/azure-devops/discovery.yml
OS configuration (Phase 03)Invoke-AzureLocalOsConfiguration.ps1pipelines/github-actions/os-configuration.ymlpipelines/gitlab/os-configuration.gitlab-ci.ymlpipelines/azure-devops/os-configuration.yml
Pre-cluster verification (the gate)Invoke-AzureLocalPreClusterVerification.ps1pipelines/github-actions/pre-cluster-verification.ymlpipelines/gitlab/stages/pre-cluster-verification.ymlpipelines/azure-devops/pre-cluster-verification.yml
ARM Validate and DeployInvoke-AzureLocalArmDeployment.ps1pipelines/github-actions/arm-deployment.ymlpipelines/gitlab/stages/arm-deployment.ymlpipelines/azure-devops/arm-deployment.yml
Post-deployment (Phase 06, the eleven tasks in one run)Invoke-AzureLocalPostDeployment.ps1pipelines/github-actions/post-deployment.ymlpipelines/gitlab/stages/post-deployment.ymlpipelines/azure-devops/post-deployment.yml
Terraform foundation and Ansible configuration (the older chain)Terraform, ansible-playbookpipelines/github-actions/azure-local-deploy.ymlpipelines/gitlab/.gitlab-ci.yml with stages/*.ymlpipelines/azure-devops/azure-local-deploy.yml

On GitLab, discovery.yml, pre-cluster-verification.yml, arm-deployment.yml and post-deployment.yml declare their own stages and are not included from .gitlab-ci.yml: include each from a pipeline file of its own. On GitHub, pipelines/github-actions/ is the only folder of deployment workflows; copy a file to .github/workflows/ in your repository.

Order for a new instance: discovery -> provisioning (azurelocal-ztp or an ISO) -> OS configuration pipeline -> the pre-cluster verification gate -> ARM Validate and Deploy pipeline -> post-deployment pipeline. The OS configuration pipeline publishes the artifact os-configuration-report, which the gate and the ARM pipeline take as their OS configuration report. The gate writes its result to a folder the ARM run reads (deployment.pre_cluster_verification_report_directory, else the environment data folder of the master file), not to the artifact, so run the ARM pipeline on the same runner or point that key at a folder both runs reach.

Post-Deployment Pipeline (Phase 06)​

After the ARM deployment succeeded, the post-deployment phase (SDN, witness, security groups, SSH, storage, VM images, network security groups, logical networks, verification, external storage, SBE import) is one automated run: Invoke-AzureLocalPostDeployment.ps1. Each platform has one thin pipeline that calls that script and nothing else. The steps, their order and what makes each one apply are in the script's step table (PostDeploymentSteps.psd1), not in the pipeline. Every task script also runs alone.

StageWhat it doesApproval
ValidateTest-InfrastructureFile.ps1 checks the master file against the schema. Read onlynone
PlanThe orchestrator with -Mode Plan: every selected step runs with -WhatIf, reads Azure and the cluster and changes nothing. Always runs, and the approver reads its summarynone
ApplyThe orchestrator with -Mode Apply, the same selection as the plan. Runs only for the mode Applythe operations environment (AZL_ENVIRONMENT_OPERATIONS)
Run choiceWhat it doesGitHub inputGitLab variableAzure DevOps parameter
ModePlan (default) stops after the plan. Apply also runs the apply behind the approvalmodePOST_DEPLOYMENT_MODEmode
One task or stepRuns only these steps or tasks, comma-separated: a task such as task-05 (both storage steps) or a step id such as storage-paths. Maps to -OnlyonlyPOST_DEPLOYMENT_ONLYonly
A rangeThe first and the last step or task, both ends included. Either may stay empty. Maps to -From and -Tofrom, toPOST_DEPLOYMENT_FROM, POST_DEPLOYMENT_TOfrom, to
Continue after warningsKeeps going after a step that ended with warnings; by default the run stops there so a person reads them. Maps to -ContinueOnWarningcontinue_on_warningPOST_DEPLOYMENT_CONTINUE_ON_WARNINGcontinue_on_warning

Leave the selection empty (none on Azure DevOps) to run every step the master file turns on. The infrastructure file is never a run choice: it is the variable AZL_INFRASTRUCTURE_FILE that Task 05 sets.

How to run one task. Start the pipeline with mode Plan and only task-08 (the logical networks). Read the plan summary. Start it again with mode Apply and the same only: the apply job waits for the approval, then runs the same step for real. After a failed run, repeat it from the step that failed with from set to that step, and mode Apply.

  • Plan first, then the approval. The apply job needs the plan and starts only when it succeeded. The approver reads the plan's summary: the table of what each step found, planned or skipped, and why.
  • One approval environment, one lock. The apply runs behind devops.pipelines.environments.operations (the variable AZL_ENVIRONMENT_OPERATIONS), the environment of every change to the cluster, so its lock keeps the SBE import and the SDN change from running beside an update or a node reboot. While the variable is empty, a run in the mode Apply fails in a refusal job (GitHub approval-environment-not-set, GitLab post-deployment-approval-environment-not-set) or the Azure DevOps stage ApprovalEnvironmentNotSet, and nothing is changed.
  • SDN is gated by the file. SDN enabled by Azure Arc cannot be undone. The script refuses the run (exit code 2, in the plan too) unless the master file carries sdn.acknowledge_maintenance_window (and sdn.acknowledge_dns_record with static DNS). The pipeline overrides none of it.
  • The report. report.json, summary.md, run.log, the log of each step and post-deployment-events.jsonl (the events of the run, the feed azurelocal-sonar reads) are published as the artifact post-deployment-plan (30 days) or post-deployment-report (90 days), also when the run failed. Exit codes: 0 every selected step passed, was planned or was skipped; 1 a step failed; 2 bad input or a refusal; 3 the run stopped after a step with warnings.
  • The runner. The general runner with PowerShell 7, a route to the nodes (WinRM, TCP 5985 or 5986) and to Azure (HTTPS). The jobs sign in by devops.authentication.method and install powershell-yaml, Az and Az.KeyVault at the versions of devops.pipelines.tool_versions. The node login is the secret reference of the master file, read from Key Vault at run time; no pipeline passes a credential.

On GitLab, post-deployment.yml declares its own stages and is not included from .gitlab-ci.yml: include it from a pipeline file of its own.

Validation and Day 2 Pipelines​

After the deployment come the validation pipeline and the four day 2 pipelines. Each exists once per platform and runs the script an operator runs by hand, and nothing else. How to run each one by hand and in a pipeline: Run the Validation in a Pipeline and Run Day 2 Operations in a Pipeline.

PipelineEntry pointGitHub ActionsGitLab CIAzure DevOps
Validation before the handover (Part 7)Test-AzureLocalClusterHealth.ps1, Test-ArcConnectivity.ps1, Test-NetworkConfiguration.ps1, Test-StoragePerformance.ps1pipelines/github-actions/validation.ymlpipelines/gitlab/stages/validation.ymlpipelines/azure-devops/validation.yml
Day 2: check for updates, on a schedule (Part 8, Task 01)Get-AvailableSolutionUpdate.azcli.ps1 (Azure view) or Get-AvailableSolutionUpdate.ps1 (cluster view)pipelines/github-actions/day2-check-updates.ymlpipelines/gitlab/stages/day2-check-updates.ymlpipelines/azure-devops/day2-check-updates.yml
Day 2: start the solution update (Task 02)Start-AzureLocalSolutionUpdate.ps1pipelines/github-actions/day2-update.ymlpipelines/gitlab/stages/day2-update.ymlpipelines/azure-devops/day2-update.yml
Day 2: take one node through maintenance (Task 03)Invoke-NodeMaintenanceReboot.ps1pipelines/github-actions/day2-node-maintenance.ymlpipelines/gitlab/stages/day2-node-maintenance.ymlpipelines/azure-devops/day2-node-maintenance.yml
Day 2: cluster operations (Task 04)Invoke-ClusterOperations.ps1pipelines/github-actions/day2-cluster-operations.ymlpipelines/gitlab/stages/day2-cluster-operations.ymlpipelines/azure-devops/day2-cluster-operations.yml
PipelineRead only, no approvalBehind the operations approval environment
Check for updatesThe whole pipeline. Runs on a schedulenone
UpdateThe plan: -WhatIf says which update it would startPrepareOnly (download and readiness checks) and Install (start the update; it does not wait)
Node maintenanceThe plan: the node is checked against nodes[] (-RequireNodeInFile) and -WhatIf prints what would happenReboot (drain, reboot, resume, wait for the storage) and Resume (only resume a node left Paused)
Cluster operationsHealthCheck, Alerts, Capacity, and the -WhatIf plan of every other actionMaintenanceMode, LiveMigrate, Rebalance
ValidationCluster health, Arc connectivity, network configuration and the storage checks without the load testThe storage load test (-RunPerformanceTest), which writes and reads a scratch file on every cluster shared volume
  • Plan first. A pipeline that changes something runs a read-only plan job first. The approved job starts only when the plan succeeded.
  • One approval environment. Every job that changes the cluster or puts load on it runs behind devops.pipelines.environments.operations (the variable AZL_ENVIRONMENT_OPERATIONS). Make it an entry of devops.environments[] with approval_required: true. While the variable is empty, a run that would change something fails in a refusal job (GitHub approval-environment-not-set, GitLab <pipeline>-approval-environment-not-set) or the Azure DevOps stage ApprovalEnvironmentNotSet, and nothing is sent to any machine.
  • Never two changes together. GitHub: the concurrency group azure-local-day2-changes-<infrastructure file> with cancel-in-progress: false (GitHub keeps only one waiting run per group). GitLab: the resource_group azure-local-day2-changes. Azure DevOps: lockBehavior: sequential and the Exclusive lock check of the one environment. The read-only jobs hold no lock.
  • One node per run. The node is a run input, checked against nodes[] of the file with -RequireNodeInFile. A name the file does not list ends the run with exit code 2 before anything is sent.
  • No password in a pipeline. The scripts connect to the cluster as the service account of the runner, which must be an administrator of the cluster. No pipeline passes -Credential. The node maintenance reads the node login from its secret reference in the file, from Key Vault, with the Azure sign-in of the job.
  • The check for updates is the alert. It fails the run when the cluster needs attention (exit code 1) and publishes its JSON report as the artifact day2-update-check. It runs on the schedule devops.pipelines.schedules.check_for_updates (a five-field cron expression in UTC, default 17 4 * * *). No platform reads a schedule from a variable, so Task 05 applies the key where each keeps it: it writes the cron line of the GitHub workflow and of the Azure DevOps pipeline (with the branch of the schedule), and creates the GitLab project schedule. The key works on all three (see Azure DevOps: the schedule).
  • The runner. The validation needs the Failover Clustering PowerShell module (RSAT Failover Clustering Tools), so a Windows runner. The Azure view of the check for updates needs the Azure CLI on the runner.

On GitLab, every one of these files declares its own stage and is not included from .gitlab-ci.yml: include each from a pipeline file of its own.

How to Use This Part​

  • Start with the platform comparison on this page
  • Choose one pipeline platform that matches your repository and approval model
  • Use the platform-specific page to configure secrets, runners or agents, and workflow structure
  • Keep the CI/CD Infrastructure section as the source of truth for runner and environment setup

Platform Pages​

PlatformDescription
GitLab CI/CDPrimary reference pipeline with modular stages and Use-AzlGitLabTool.ps1 for the tool versions
GitHub ActionsGitHub-native workflow equivalent with environment protection
Azure DevOps PipelinesAzure DevOps implementation using service connections and agent pools
ARM Validate and DeployThe pipeline that runs Microsoft's ARM template through Validate, approval and Deploy, on all three platforms

Next Steps​

After choosing a platform, continue to Part 3: Automation Guides for the Terraform, Ansible, Bicep, and PowerShell assets that your pipeline will call.