Home > OS >  How to trigger Azure devops pipeline from different project within same organization using stage/res
How to trigger Azure devops pipeline from different project within same organization using stage/res

Time:11-22

I want to trigger a Test pipeline from a stage of Main pipeline, both the pipelines are present in different projects within the same organization. I am able to trigger the pipeline using the resource option but the problem is it triggers the Test pipeline when Main pipeline finishes successfully but I want to trigger the Test pipeline in between run of Main pipeline using an stage. Is it possible to achieve this using any feature of Azure Devops?



For now I am adding this resource in Test pipeline yaml to trigger after Main pipeline.

resources:
  pipelines:
  - pipeline: Test-Repo 
    source:  Test # Test pipeline from different project
    project: private 
    trigger: true # enable the trigger

CodePudding user response:

As a workaround, you can trigger the needed build through REST API. Check this: Powershell to trigger a build in Azure DevOps

CodePudding user response:

I agree with shamrai's workaround. And you could refer to this doc for more variable resource trigger

In my test for your scenario.

resources:
  pipelines:
  - pipeline: MyCIAlias
    project: yyy
    source: xxx-CI 
    trigger: true

If his answer or my post could help with your issue, you could check this wiki for more reference to help more users.

  • Related