Skip to main content

Azure DevOps Pipelines

Reference Azure

DOCUMENT CATEGORY: Reference SCOPE: Azure DevOps CI/CD pipeline configurations PURPOSE: Document Azure DevOps pipelines for Azure Local deployments MASTER REFERENCE: Azure DevOps Documentation

Status: Active


Overview​

Azure DevOps Pipelines configuration for Azure Local deployments. This is a sample equivalent of the primary GitLab CI/CD pipeline, adapted for Azure Pipelines with service connections, environment approvals, and the Terraform task extension.

Pipeline​

File: pipelines/azure-devops/azure-local-deploy.yml

Stages​

StageAgent PoolApprovalDescription
ValidateAZL_AGENT_POOL for the check of the master file (Test-InfrastructureFile.ps1, job CheckInfrastructureFile); ubuntu-latest for Terraform validate and Ansible lintNoneThe master file, Terraform validate, Ansible lint (the same three checks as GitHub and GitLab)
Planubuntu-latestNoneWrites the variable files, Terraform plan with artifact (default branch only)
DeployFoundationAZL_AGENT_POOLThe environment named by AZL_ENVIRONMENT_TERRAFORM_DEPLOYMENTTerraform apply
ConfigureOnPremAZL_AGENT_POOLThe environment named by AZL_ENVIRONMENT_TERRAFORM_DEPLOYMENTPlaybooks 05 (domain controllers), 01 (AD preparation), 02 (OS configuration), 03 (Arc registration)
ConfigureOperationsAZL_AGENT_POOLThe environment named by AZL_ENVIRONMENT_TERRAFORM_DEPLOYMENTPlaybook 04 (monitoring)
ApprovalEnvironmentNotSetAZL_AGENT_POOLNoneExists instead of the three stages above while AZL_ENVIRONMENT_TERRAFORM_DEPLOYMENT is empty. It fails after the plan with a message that names the file to edit. Nothing is changed

No value of a deployment is written in the pipeline file, and none is a run parameter (D126). The pipeline names no pool, environment, service connection, variable group, infrastructure file or tool version. Azure DevOps resolves the pool, the service connection and the variable group when it compiles the pipeline, and a template expression sees only the variables of the YAML files, not those stored in a library or on the pipeline (Template expressions), so every Azure DevOps pipeline of the toolkit includes two YAML files of the repository and reads these values from them as compile-time variables, with the same names GitHub and GitLab read as variables:

Variable of pipelines/azure-devops/variables/pipeline-settings.ymlValue from infrastructure.yml
AZL_AGENT_POOLdevops.runners[].pool of the general runner
AZL_SERVICE_CONNECTIONdevops.pipelines.service_connection
AZL_VARIABLE_GROUP (also written as the - group: entry of the file)devops.pipelines.variable_group: the repository group, which Task 05 writes besides one group per environment
AZL_INFRASTRUCTURE_FILEdevops.pipelines.infrastructure_file
AZL_HANDOFF_PATHdevops.pipelines.handoff_path

Task 05 of the CI/CD setup writes this file and approval-environments.yml from infrastructure.yml; commit both in a pull request and run Task 05 again after you change the file. The toolkit ships them empty, and Azure DevOps refuses to compile a pipeline with an empty pool, so nothing runs before they are written. No run form asks for these values, a scheduled run needs none, and whoever queues a run cannot change them. Start the pipeline by hand (trigger: none), like the same pipeline on GitHub and GitLab. The parameters left are choices of one run (mode, nodes, steps, resume, an artifact run ID) and default to the safe choice (Plan, all, false, none).

The Plan stage runs only on the default branch, AZL_DEFAULT_BRANCH of the variable group (devops.repository.default_branch), because Azure DevOps has no predefined variable with the default branch. Every Terraform and Ansible job writes its inputs from the infrastructure file first (config/variables/scripts/New-IacVariableFiles.ps1); Terraform plans with the generated terraform.tfvars.json, and the Ansible jobs copy hosts.yml, group_vars and host_vars into src/ansible/inventory (git-ignored there). Playbook 02 runs Invoke-AzureLocalOsConfiguration.ps1 on the agent with -e azurelocal_os_configuration_infrastructure_file=<AZL_INFRASTRUCTURE_FILE>.

The Terraform init steps pass the state settings of the variable group to the backend: TF_BACKEND_RG, TF_BACKEND_SA, TF_BACKEND_CONTAINER and TF_BACKEND_KEY (devops.state.azure_local_key).

Triggers​

trigger: none

Setup​

1. Service Connection​

Task 05 of the CI/CD setup creates the Azure Resource Manager service connection with workload identity federation (no client secret), named by devops.pipelines.service_connection (for example iic-azure-local). Task 01 puts the same name in the subject of the federated credential. To create it by hand:

  1. Project Settings → Service connections → New → Azure Resource Manager
  2. Select workload identity federation
  3. Name: the value of devops.pipelines.service_connection
  4. Scope: Target subscription

2. Variable Group​

Task 05 also creates the variable group named by devops.pipelines.variable_group (for example iic-azure-credentials), one per entry of devops.environments[], named <name>-<environment>. It holds:

VariableSecretDescription
ARM_CLIENT_IDNoService Principal ID
ARM_CLIENT_SECRETYesService Principal Secret (only with devops.authentication.method: client_secret)
ARM_TENANT_IDNoTenant ID
ARM_SUBSCRIPTION_IDNoSubscription ID
TF_BACKEND_RGNoTerraform state resource group (devops.state.resource_group)
TF_BACKEND_SANoTerraform state storage account (devops.state.storage_account)
TF_BACKEND_CONTAINERNoTerraform state container (devops.state.container, default tfstate)
TF_BACKEND_KEYNoTerraform state file (devops.state.azure_local_key)
AZL_AUTH_METHODNodevops.authentication.method (oidc or client_secret)
AZL_TERRAFORM_VERSION, AZL_PYTHON_VERSION, AZL_ANSIBLE_CORE_VERSION, AZL_ANSIBLE_LINT_VERSION, AZL_AZ_POWERSHELL_VERSION, AZL_POWERSHELL_YAML_VERSION, AZL_AZ_KEYVAULT_VERSIONNodevops.pipelines.tool_versions.terraform, .python, .ansible_core, .ansible_lint, .az_powershell, .powershell_yaml, .az_keyvault
AZL_DEFAULT_BRANCHNodevops.repository.default_branch
AZL_RUNNER_SSH_PUBLIC_KEYNodevops.runners[].admin_ssh_public_key of the Linux runner

Sign-in follows AZL_AUTH_METHOD: with oidc the service connection uses workload identity federation (made by Task 05) and the scripts read $env:idToken; with client_secret they read the service connection's secret, $env:servicePrincipalKey. A managed identity of the agent is not a sign-in method of the pipelines.

Both keys are required on Azure DevOps. Before schema 5.6.27 the names were fixed (AzureLocal-ServiceConnection, azurelocal-secrets, azure-credentials, azurelocal-os-configuration); set the keys to the names you already use to keep them.

3. Approval environments​

In every pipeline on this page, a stage that changes a system is a deployment job in an environment with an Approvals check. Each pipeline takes the name of its environment from a variable of pipelines/azure-devops/variables/approval-environments.yml. This is a YAML file of the repository. Each pipeline includes it (- template: variables/approval-environments.yml) and reads it when the pipeline is compiled.

The approval environment is not a run parameter. A deployment job in an environment with no check runs without an approval. With a run parameter, the person who queues a run could type the name of such an environment. A template expression sees only the variables of YAML files. It does not see the variables stored on the pipeline, in a library or given in the run form (Template expressions). So the queuer cannot choose the environment.

Variable of approval-environments.ymlValue from infrastructure.ymlPipeline and stage
AZL_ENVIRONMENT_OS_CONFIGURATIONdevops.pipelines.environments.os_configurationos-configuration.yml, stage Apply
AZL_ENVIRONMENT_OS_CONFIGURATION_CLEAR_STORAGEdevops.pipelines.environments.os_configuration_clear_storageos-configuration.yml, stage ConfirmStorageWipe
AZL_ENVIRONMENT_ARM_DEPLOYMENTdevops.pipelines.environments.arm_deploymentarm-deployment.yml, stage Deploy; pre-cluster-verification.yml, stage VerifyWithChanges
AZL_ENVIRONMENT_CICD_INFRAdevops.pipelines.environments.cicd_infracicd-infra.yml, stage Apply (when apply is on)
AZL_ENVIRONMENT_TERRAFORM_DEPLOYMENTdevops.pipelines.environments.terraform_deploymentazure-local-deploy.yml, stages DeployFoundation, ConfigureOnPrem and ConfigureOperations
AZL_ENVIRONMENT_OPERATIONSdevops.pipelines.environments.operationsday2-update.yml, day2-node-maintenance.yml, day2-cluster-operations.yml and post-deployment.yml, stage Apply; validation.yml, stage StoragePerformance

The toolkit ships the variables empty, because no value of a deployment is written in the toolkit. Task 05 writes the value of each one from infrastructure.yml (D126); commit the file in a pull request. The names are the same as the GitHub repository variables and the GitLab project variables of the same purpose. When you copy a pipeline to your own repository, copy approval-environments.yml with it.

While a variable is empty, the stages that change something do not exist. A run that would change something fails in the stage ApprovalEnvironmentNotSet with a message that names the file, and nothing is changed. For the storage wipe of the OS configuration, the stage ConfirmStorageWipe fails instead and Apply does not run. The stages that only read (Validate, Plan, Preconditions, Verify) run as before and have no environment.

Each value must be an entry of devops.environments[] with approval_required: true. Task 04 of the CI/CD setup creates these environments. To create one by hand:

  1. Pipelines → Environments → New environment → the name from the file
  2. Approvals and checks → add an Approvals check with required reviewers
  3. Add an Exclusive lock check, so that two runs never work on the same system at once
  4. Add a Branch control check: allowed branches refs/heads/<your default branch>, with "Verify branch protection" on

Add the checks before the first run.

Why the Branch control check is needed. The run form lets the person who queues a run choose the branch, and the pipeline is compiled from that branch, with that branch's copy of approval-environments.yml. Someone who can push a branch could change the file there. The checks of an environment or a service connection are set in Azure DevOps, not in YAML, so a branch cannot change them. Add the same Branch control check to the service connection and the agent pool the pipelines use. Also limit the pipeline permissions of each environment and service connection to the toolkit's pipelines.

4. Self-Hosted Agent Pool​

Create the agent pool that devops.runners[].pool names (required on Azure DevOps; there is no default pool):

  1. Organization Settings → Agent pools → Add pool
  2. Pool type: Self-hosted, Name: the pool name from the file
  3. Register an agent with on-premises network access

5. Terraform Extension​

Install the Terraform extension from the marketplace:

  1. Organization Settings → Extensions → Browse marketplace
  2. Search "Terraform" → Install "Terraform by Microsoft DevLabs"

Key Features​

  • Service Connections: Azure auth via ARM service connection (no secrets in pipeline)
  • Terraform Task v4: Native Terraform task with backend auto-configuration
  • Environment Approvals: Deployment gates between stages, on the environments named in approval-environments.yml
  • Variable Groups: Centralized secret management
  • Deployment Strategy: runOnce strategy for controlled rollouts

OS Configuration Pipeline​

File: pipelines/azure-devops/os-configuration.yml (create a pipeline from the existing YAML file; no trigger). It runs Invoke-AzureLocalOsConfiguration.ps1 and nothing else.

StageDescription
PlanRead only. Publishes the plan report and the wipe list as the build artifact os-configuration-plan
ConfirmStorageWipeRuns only when the mode is Apply and clear_storage is true: a second, separate approval (the same on GitHub and GitLab, D126) after reading the wipe list, in the environment named by AZL_ENVIRONMENT_OS_CONFIGURATION_CLEAR_STORAGE (devops.pipelines.environments.os_configuration_clear_storage). While that variable is empty, this stage fails in the run that would wipe, and Apply does not run
ApplyRuns for mode Apply, after a reviewer of the environment named by AZL_ENVIRONMENT_OS_CONFIGURATION approves (devops.pipelines.environments.os_configuration)
ApprovalEnvironmentNotSetExists for mode Apply instead of ConfirmStorageWipe and Apply while AZL_ENVIRONMENT_OS_CONFIGURATION is empty. It fails after the plan with a message that names the file to edit. Nothing is changed

Both approval environments are variables of pipelines/azure-devops/variables/approval-environments.yml, not run parameters (see 3. Approval environments). Set up a self-hosted agent pool with PowerShell 7, Az.Accounts and Az.KeyVault and a route to the nodes' management subnet; an Azure Resource Manager service connection with workload identity federation; and add Approvals (and an Exclusive lock) to the environments. The pool, the service connection, the variable group, the infrastructure file and the handoff path (none for an ISO-installed cluster) are the variables of pipeline-settings.yml that Task 05 writes, not run parameters. The run choices mode, nodes, steps, handoff_pipeline_id, handoff_run_id, approved_bootstrap and confirm_wipe_deployed_cluster default to Plan, all, none and false. See Automated OS configuration.

Discovery Pipeline​

File: pipelines/azure-devops/discovery.yml (create a pipeline from the existing YAML file; no trigger). It runs scripts/common/discovery/Invoke-AzlDiscoveryRun.ps1 and nothing else.

StageDescription
DiscoverRead only, no approval environment: nothing in the run changes a BMC, a node, Azure or Active Directory. Publishes the report as the build artifact discovery-report and summary.md as the run summary. Two runs never run together: the stage sets lockBehavior: sequential, so the second waits its turn

The infrastructure file, the pool, the service connection and the variable group are the variables of pipeline-settings.yml that Task 05 writes (D126), not run parameters. Run choices:

ParameterMeaning
scopeall (default: hardware inventory, Azure tenant and Active Directory), hardware (any maker, standard Redfish API), dell (Dell iDRAC only, with the proposal for nodes[]), tenant or directory
management_portScope dell: the management port of every node, by suggested name or MAC. none (default): the MAC already in the file
write_backScope dell: put the serial numbers and MAC addresses found into a copy of the master file, in the artifact (write-back/). The file in the repository is not changed and nothing is committed: review the copy and commit it through a pull request
include_rbacScope tenant: also record the role assignments

The artifact holds discovery-report.json, summary.md and a folder per step. It is published even when a step fails; the run fails when a step fails. The service connection needs Reader on the subscriptions of the tenant inventory and Key Vault Secrets User on the vault of the BMC login. The variable group holds no BMC password: the login is the secret reference in infrastructure.yml (hardware.bmc, or nodes[].bmc), read from Key Vault at run time. The agent needs a route to the BMC addresses (HTTPS, TCP 443) and, for the directory step, the ActiveDirectory module (RSAT) on a domain-joined agent.

Pre-cluster Verification Pipeline​

File: pipelines/azure-devops/pre-cluster-verification.yml (create a pipeline from the existing YAML file; no trigger). It runs scripts/deploy/04-cluster-deployment/phase-05-cluster-deployment/Invoke-AzureLocalPreClusterVerification.ps1 and nothing else. Run it after the OS configuration and before the ARM Validate: the ARM run refuses to go on without a passing, current result of it for the same master file.

StageDescription
VerifyRead only. Mode Plan (what would be checked, offline) or Verify (every check, against Azure, Active Directory and the nodes)
VerifyWithChangesRuns instead of Verify when the parameter fix or install_environment_checker is set: a deployment job in the approval environment named by the variable AZL_ENVIRONMENT_ARM_DEPLOYMENT (devops.pipelines.environments.arm_deployment); add an Approvals check to it. fix registers the mandatory resource providers that are not registered (Azure side only). install_environment_checker puts the Environment Checker on the nodes for this run and removes it again at the end
ApprovalEnvironmentNotSetRuns instead of VerifyWithChanges when fix or install_environment_checker is set but AZL_ENVIRONMENT_ARM_DEPLOYMENT is empty. It fails with a message that names the file to edit. Nothing is changed

The approval environment is not a run parameter. As in every pipeline on this page that changes something, it is a variable of pipelines/azure-devops/variables/approval-environments.yml: here AZL_ENVIRONMENT_ARM_DEPLOYMENT, the same as the ARM deployment pipeline (see 3. Approval environments). The toolkit ships the variable empty: write the name once, in a pull request (Task 05 lists the value). While it is empty, the read-only Verify stage runs as before, and a fix or install_environment_checker run fails in ApprovalEnvironmentNotSet and changes nothing.

The result of a run replaces the one before, so the stages Verify and VerifyWithChanges set lockBehavior: sequential: two runs of the same stage never run together and the second waits. lockBehavior decides how runs behave when they meet an Exclusive lock check; set at the pipeline level, it also makes the Exclusive lock on the approval environment queue the runs instead of cancelling the older ones.

The infrastructure file, the pool, the service connection and the variable group are the variables of pipeline-settings.yml that Task 05 writes (D126), not run parameters. Run choices: mode (default Plan), os_configuration_pipeline_id and os_configuration_run_id (the artifact os-configuration-report of an OS configuration run) or os_configuration_report (a repository path), handoff_file, accept_skipped (ids of checks that may stay Skipped, comma separated; the report records that you accepted them), allow_revalidate, fix, install_environment_checker. The text choices default to none, the switches to false.

The run fails when the verdict is not Pass (exit code 1: a Failed or Skipped check blocks; 3: a partial run). Each stage publishes report.json, summary.md and the event feed as the build artifact pre-cluster-verification and summary.md as the run summary.

The ARM run reads a folder, not the artifact

The pipeline passes no -ReportDirectory. The script writes its result where the ARM run reads it: deployment.pre_cluster_verification_report_directory, else arm-report/verification/live in the environment data folder of the master file. The artifact is only a copy. Run the ARM pipeline on the same agent, or set deployment.pre_cluster_verification_report_directory to a folder both runs reach.

The service connection needs Reader for the checks (Owner or Contributor for fix) and Key Vault Secrets User on the vaults of the local administrator and the LCM user. The agent needs a route to the nodes (WinRM, TCP 5985 or 5986), to a domain controller (LDAP, TCP 389) and to the DNS servers of the file. A check the agent cannot ask is Skipped with its reason, and a Skipped check blocks the verdict until you accept its id. Details: Pre-cluster verification gate.

ARM Validate and Deploy Pipeline​

File: pipelines/azure-devops/arm-deployment.yml.

StageDescription
PreconditionsRead only. Parameters and every precondition. Always runs
ValidateRuns for mode Validate and ValidateAndDeploy
DeployRuns for mode ValidateAndDeploy and Deploy. A deployment job in the environment named by AZL_ENVIRONMENT_ARM_DEPLOYMENT of pipelines/azure-devops/variables/approval-environments.yml (devops.pipelines.environments.arm_deployment); add an Approvals check to that environment (Pipelines, Environments, Approvals and checks). It re-checks every precondition and that these parameters validated. resume resubmits a failed Deploy
ApprovalEnvironmentNotSetExists for mode ValidateAndDeploy and Deploy instead of Deploy while AZL_ENVIRONMENT_ARM_DEPLOYMENT is empty. It fails with a message that names the file to edit. Nothing is deployed

The infrastructure file, the service connection, the variable group and the pool are the variables of pipeline-settings.yml that Task 05 writes (D126), and the approval environment is not a run parameter either (see 3. Approval environments). Run choices: mode (default Plan), osConfigurationPipelineId and osConfigurationRunId (the OS configuration report artifact, default none) or osConfigurationReport, handoffFile, resume, acknowledgeKnownIssues. The Validate and Deploy jobs have a fixed upper bound of 1500 minutes (the registry maximum of deployment.validate_timeout_minutes and deployment.deploy_timeout_minutes, 1440, plus 60), because a job timeout is read before any variable exists; the script's own wait is the real limit. Details: ARM Validate and Deploy automation.

Post-Deployment Pipeline​

File: pipelines/azure-devops/post-deployment.yml. Run it after the ARM deployment succeeded. It runs Invoke-AzureLocalPostDeployment.ps1, the eleven tasks of Phase 06 in one run, and nothing else. No trigger (trigger: none).

StageDescription
ValidateRead only. Test-InfrastructureFile.ps1 checks the master file. Always runs
PlanRead only. -Mode Plan: every selected step with -WhatIf. Always runs after Validate; its summary is what the approver reads
ApplyRuns for the parameter mode Apply. A deployment job in the environment named by AZL_ENVIRONMENT_OPERATIONS of pipelines/azure-devops/variables/approval-environments.yml (devops.pipelines.environments.operations); add an Approvals check and an Exclusive lock to that environment. -Mode Apply, the same selection. lockBehavior: sequential keeps it from running beside an update or a node reboot
ApprovalEnvironmentNotSetExists for Apply instead of Apply while AZL_ENVIRONMENT_OPERATIONS is empty. It fails with a message that names the file to edit. Nothing is changed

Run choices: mode (Plan or Apply, default Plan), only (steps or tasks, comma-separated, for example task-05 or storage-paths; default none), from and to (a range; default none), continue_on_warning (default off). none for all three selection parameters runs every step the file turns on. The infrastructure file, the service connection, the variable group and the pool are the variables of pipeline-settings.yml that Task 05 writes (D126); the approval environment is not a run parameter (see 3. Approval environments). The artifacts are post-deployment-plan and post-deployment-report. How to run one task, the SDN gate and the exit codes: Post-Deployment Pipeline.

Validation and Day 2 Pipelines​

Five pipelines run the scripts of Part 7 and Part 8 of the implementation guide, each the command an operator runs by hand and nothing else. Create a pipeline from each existing YAML file; none has a trigger (trigger: none). How to run each script by hand and in a pipeline: Run the Validation in a Pipeline and Run Day 2 Operations in a Pipeline.

FileRead-only stage (no approval)Approved stageRun choices
pipelines/azure-devops/validation.ymlValidate: the four validation scripts; the storage script without its load testStoragePerformance: Test-StoragePerformance.ps1 -RunPerformanceTest, only when asked, after Validate passedrun_performance_test (default off)
pipelines/azure-devops/day2-check-updates.ymlCheckAzure (Azure CLI, no node access) or CheckCluster (PowerShell remoting)nonesource (azure, the default, or cluster)
pipelines/azure-devops/day2-update.ymlPlan: Start-AzureLocalSolutionUpdate.ps1 -WhatIfApply: PrepareOnly or Installaction (default Plan), update_mode (default AfterDeployment)
pipelines/azure-devops/day2-node-maintenance.ymlPlan: the node is checked against nodes[] with -RequireNodeInFile, then -WhatIfApply: Reboot or Resume (-ResumeOnly)node (one node), action (default Plan)
pipelines/azure-devops/day2-cluster-operations.ymlReadOnly (HealthCheck, Alerts, Capacity), or Plan (-WhatIf) for a changeApply: MaintenanceMode, LiveMigrate or Rebalanceaction, node, enable
  • Plan first. The approved stage depends on the read-only stage and starts only when it succeeded.
  • One approval environment. Every approved stage is a deployment job in the environment named by AZL_ENVIRONMENT_OPERATIONS of pipelines/azure-devops/variables/approval-environments.yml (devops.pipelines.environments.operations), bound when the pipeline is compiled (see 3. Approval environments). While it is empty, a run that would change something fails in the stage ApprovalEnvironmentNotSet and changes nothing; the read-only stages run as before. The Branch control check of 3. Approval environments applies to this environment too.
  • One change at a time. lockBehavior: sequential on the pipeline and on the approved stage, and the Exclusive lock check of the one operations environment. That check is what keeps an update and a node reboot apart. The read-only stages hold no lock.
  • One node per run. The parameter node is checked against nodes[] with -RequireNodeInFile. A name the file does not list ends the run with exit code 2 before anything is sent. AZL_INFRASTRUCTURE_FILE of the settings file on the branch names the file, so the node check trusts the files of that branch: keep the infrastructure files under review (a branch policy on the protected default branch), and run the changing pipelines from that branch.
  • A failed script fails the run. The report, plan or log is published as a pipeline artifact even then.

The infrastructure file, the pool and the variable group come from pipeline-settings.yml in every pipeline, and the service connection in day2-check-updates.yml and day2-node-maintenance.yml, the two that sign in to Azure; none is a run parameter (D126). The variable group gives AZL_POWERSHELL_YAML_VERSION, and for the node maintenance also AZL_AZ_POWERSHELL_VERSION and AZL_AZ_KEYVAULT_VERSION. For the check for updates (source azure) the service connection needs Azure Stack HCI Administrator or Reader on the cluster resource. For the node maintenance it needs Key Vault Secrets User on the vaults of the local administrator and the LCM user.

The account. The scripts connect to the cluster as the account the agent runs as, which must be an administrator of the cluster. No pipeline passes -Credential or holds a password. The node maintenance reads the node login from its secret reference in infrastructure.yml (identity.local_admin), from Key Vault, through the service connection. The validation needs the Failover Clustering PowerShell module (RSAT Failover Clustering Tools) on the agent, so a Windows agent. The Azure view of the check for updates needs the Azure CLI on the agent.

The schedule of the check for updates​

The check for updates fails the run when the cluster needs attention (exit code 1), so Azure DevOps' notification of a failed build is the alert. The report is the pipeline artifact day2-update-check. Its schedule is the key devops.pipelines.schedules.check_for_updates: a five-field cron expression in UTC, default 17 4 * * * (every day at 04:17).

day2-check-updates.yml runs on this schedule as it is (D126: the key works on GitHub, GitLab and Azure DevOps). An Azure DevOps schedule cannot use variables and must be in the main YAML file (Configure schedules for pipelines), so the cron line and the branch are written in the file: the sample carries the registry defaults of devops.pipelines.schedules.check_for_updates and devops.repository.default_branch, and Task 05 writes the values of your infrastructure.yml into both lines (commit them). A scheduled run cannot be asked for a parameter, and it needs none: the deployment values are the variables of pipeline-settings.yml, and the only parameter, source, defaults to azure. Define no schedule in the pipeline's Triggers settings: those take precedence over the YAML schedule. An empty key means no schedule: remove the block in a pull request.

schedules:
- cron: '17 4 * * *' # devops.pipelines.schedules.check_for_updates (UTC), written by Task 05
displayName: Check for updates
branches:
include:
- main # devops.repository.default_branch, written by Task 05
always: true # a check of the cluster, not a build: run even when the code did not change

Repository​

Source: azurelocal-toolkit/pipelines/azure-devops/


PreviousUpNext
GitHub ActionsPart 2: CI/CD PipelinesPart 3: Automation Guides