azure-devopsazure-pipelinesmultibranch-pipelineazure-devops-pipelines

Multi branch Pipeline in Azure Devops


I am trying to build a YAML release pipeline in Azure DevOps for that I have created multiple branches to keep environment-specific files

first image

I created 4 pipelines for release as well:

second image

Problem: Whenever I am making any changes in any branch, all the branch pipeline starts running. If I run an individual pipeline it works fine.

# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml

trigger:
- acc

pool:
  name: 'Agent'

steps:

- task: Kubernetes@1
  displayName: 'Deploy on  K8s Cluster'
  inputs:
    connectionType: 'Azure Resource Manager'
    azureSubscriptionEndpoint: 'vs-aks-sc'
    azureResourceGroup: 'azwe-rg-01'
    kubernetesCluster: 'azwe-aks-01'
    command: 'apply'
    arguments: '-f $(System.DefaultWorkingDirectory)/kubernetes/acc.yaml'

third

deploy


Solution

  • You should check the CI trigger setting of the pipeline to only allow it to trigger on your wanted branches

    Change CI Trigger