Search code examples
azure-devopscontinuous-integrationazure-pipelinesdevopscontinuous-deployment

Trigger a Release (CD) pipeline from Build (CI) pipeline YAML file in Azure DevOps


I am trying to figure out, How to trigger Release (CD) pipeline from a Build (CI) pipelines YAML file in Azure DevOps CICD. So is there a possibility to trigger like that is my first question.

My second question is: If we can trigger a Release pipelines from Build pipelines YAML file then how to write a stage for that. For Eg. Once we trigger from build pipeline, it should be like trigger and forget, means the CI pipeline should not wait for the CD pipeline should get complete, it should trigger it and complete its process. The CD pipeline should gets trigger once the CI pipeline sends a trigger to it.

enter image description here


Solution

  • In order to trigger your release pipeline you should navigate on the Release pipelines and edit the continuous deployment trigger.

    enter image description here

    There you should select enable and whenever a build runs it can also trigger your release.

    enter image description here

    The way the procedure works is that when a build is completed then the release pipeline will be triggered. In order to trigger a release pipeline regardless of the build pipeline execution you should use the Azure devops rest API