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

azure : build pipeline dependent branch


On azure, I have 3 branches :

  • dev
  • release
  • master

I created 3 build pipelines, one per branch. Each pipeline gets the sources from his specific branch and creates each on artefact. For the deployment, I created 3 release deployment. All theses pipelines are classic pipeline.

Everything is working great. But I want to simplify this process. For these 3 branches, in classic mode, How can I make just ONE build pipeline and ONE release pipeline for this (no 3 build and release pipelines)? Is is possible?


Solution

  • TL;DR yes, it is possible to have only one build pipeline and only one release pipeline.

    Build pipeline

    You can manually choose the branch when queuing a new build:

    Manually choosing the branch

    Or, as an alternative, you can enable continuous integration and set up multiple branch builds for your repository:

    Enable Continuous Integration for branches

    Remember to set a meaningful name to your build pipeline, ideally containing the branch name to avoid deploying the wrong artifacts when running the release pipeline:

    Setting build name

    See:

    Release pipeline

    When creating or configuring the release pipeline you can configure to use an artifact from the build pipeline like this:

    Release artifact

    And then, when creating a new release, you can choose which artifact to deploy :

    Release pipeline - select artifacts

    Or, as an alternative, configure a continuous deployment trigger based on the branch:

    Release pipeline - CI trigger