How to Test Yaml Pipeline in Azure

… without making a pull request every time you make a change

My yaml pipeline was setup to be triggered by the master branch. The problem was the master branch did not allow direct commits so for a while I was making a pull request for every change to see if it worked.

Fortunately, I soon realized that I could create a new branch and list that branch as a trigger in the yaml. Before this, I didn’t know that Azure Devops watches for changes in all branches of my repository. So when I pushed the change to the pipeline yaml file, it evaluated the trigger settings in the updated YAML file to determine whether to run the pipeline.

Example:

Lets say the branch I created was called ‘client-app-pipeline-test’. Within that branch I modified my yaml by adding client-app-pipeline-test to the triggers.

trigger:
  branches:
    include:
    - main
    - client-app-pipeline-test

Then I pushed the changes and the pipeline ran! Why didn’t I do this sooner!