Search code examples
azure-devopscontinuous-integrationazure-pipelinesazure-pipelines-yaml

Azure DevOps Pipeline resource triggers


I am attempting to run one Azure pipeline after another finishes. After reading the Microsoft documentation I have implemented the following 2 pipelines. However the second pipeline does not trigger when the first has completed

Here is the yml file for the source pipeline Also the name for this in the Azure DevOps pipelines page is: Source Pipeline

# https://aka.ms/yaml

trigger: none

jobs:
  - job: test
    displayName: 'Test'
    pool:
      vmImage: 'ubuntu-latest'
    steps:
      - checkout: none
      - script: |
          #!/bin/bash
          set -e
          echo 'Test'
        displayName: 'Test'

And here is the pipeline that should run automatically when this above one completes: The name for this one in the Pipelines page is: Test for Pipeline Resource Trigger

# https://aka.ms/yaml


trigger: none

resources:
  pipelines:
    - pipeline: 'Test'
      source: 'Source Pipeline'
      trigger: true

jobs:
  - job: test
    displayName: 'Test'
    pool:
      vmImage: 'ubuntu-latest'
    steps:
      - checkout: none
      - script: |
          #!/bin/bash
          echo 'Test'
        displayName: 'Test'

I was expecting Test for Pipeline Resource Trigger to run after the completion of Source Pipeline however despite numerous attempts with various syntaxes as well as moving the pipelines out of pipeline folders I have had no luck.

Any tips on what I could be doing wrong would be appreciated!

Thanks.


Solution

  • Turns out this post was the solution to my particular issue, you live and learn... 🤦 I suspect it was not triggering as my yaml files are currently not in the default branch (main) and are still on seperate branches,

    Azure Pipeline Triggers in Azure Devops: Trigger a pipeline when another completes not working as expected