2
votes

I created a new pipeline in Azure DevOps, and created a new branch for it.

As a result, DevOps automatically committed the YAML file for the new pipeline to my 'development' branch.

None of the other pipelines I've created have YAML files committed into the repo...

Why does it do this?

Do we have to keep the YAML file there?

It has nothing to do with the source code of the application, so doesn't seem to make sense why its stored there.

2

2 Answers

1
votes

YAML is code for how your application is deployed, thus it is part of the source code. By putting it under source control it can keep track of version changes and any additional changes to parameters or variables that are determined or inserted in the build process.

This is opposed to the older ways of doing things where it was updated via UI and not source control and did not have peer reviews, branching merging, and additional polices that can be applied.

This on top of the the YAML Pipelines for Releases going GA the other week will make YAML under a repo even more powerful as the YAMLs will not only build but also release code.

1
votes

In Azure Devops Service we define pipelines using the YAML syntax or through the user interface (Classic). So there're two kinds of pipelines, Yaml pipelines and Classic UI(Classic build and release) pipelines.

None of the other pipelines I've created have YAML files committed into the repo...

Why does it do this?

It's expected behavior when defining pipelines using Yaml syntax: The pipeline is versioned with your code. It follows the same branching structure.

And one advantage for this is: A change to the build process might cause a break or result in an unexpected outcome. Because the change is in version control with the rest of your codebase, you can more easily identify the issue.

To sum up, the yaml pipeline will be added into version control and it's by-design behavior. If you don't want this behavior, you can feel free to use Classic Build and Classic Release pipelines. It's also a good choice! About the differences between these formats you can check Feature availability. Hope it helps :)