YAML Deployment Pipelines
In Jun `21 I had the opportunity to present to the Omaha Azure User’s Group on the topic of YAML Pipelines within Azure DevOps. Here is the abstract and the recording. Enjoy!
Abstract
With Microsoft migrating away from the Classic Build and Release Process and replacing that with the Pipeline Experience one can be left with where to start and organize this. Anyone can quickly build a YAML pipeline to deploy their app and IaC; however, can you adeptly template and variablize them? How about dynamically building stages while scoping variable files via templates? All of this is effort to lower the barrier of entry on deploying your code while maintaining flexibility.
Hi John, great session with lots of things i wasn’t aware of. One question though, where are you getting your values for the yaml objects (variable.yml?) or do you hardcode all your values in the template parameters?
Hey Chris, it really depends what you are trying to accomplish. What is shown is a combination of couple different options.
First there is an [environmenName].varaibles.yml whose intent is to share non secret variables across all pipelines in an environment. It is loaded in as a template. This is provide source control around configuration items like Service Connection Name, Terraform backend configuration, etc..
Variables can also be defined as variable groups to hold secrets. Would advise using this if inserting things like passwords and connection strings. This would be scoped accordingly to.
Variables are also scoped to the local project in the example walked through. This is to show that app configuration settings can also be loaded and deployed via variables.
Additionally I believe there is a local variable being used to concentante values.
The question(s) to ask would be:
Would another pipeline use this? If so how?
What if I need to change it, what will be impacted?
Is there a security requirement?
Hi Jon, I’m replacing existing task groups with templates (migrating pipelines to yaml). I noticed that a large proportion of task groups were the same, except for the number of times this call things like vsbuild (depends on the number of components in an app). I am using objects and loops to make the templates as reusable as possible. Your blog and video have been really helpful, it just took me a while to fit it all together. I’m surprised the documentation on this isn’t better, well actually I’m not. Azure DevOps docs always seem like an opportunity to improve something 😀
Haha I hear on that documentation….a lot of this was trial and error so appreciate the feedback! If it helps for the VSBuild comment….I’ve used passing in the list of projects (defined in the Pipeline for a specific repository) to build as an object and then pass that along to a reusable build/publish for the individual projects contained in the solution if that makes sense. This helps speed up the process when using parallel agents as the builds can happen across multiple agents.