šŸ”„Azure DevOps YML Terraform Pipeline and Pre-Merge Pull Request Validation

Kyler Middleton
The Startup
Published in
2 min readJan 7, 2020

--

This blog series focuses on presenting complex DevOps projects as simple and approachable via plain language and lots of pictures. You can do it!

tl;dr: Hereā€™s YML code that will build an Azure DevOps pipeline that can be run automatically as part of pull request validation (pre-merge) and requires manual approval by definable admin groups in order to proceed to modifing resources.

Microsoftā€™s Azure DevOps (ADO) is an incredibly powerful CI/CD platform that is being rapidly developed by $MSFT. However, as with any rapidly-evolving product, the documentation sometimes leaves something to be desired. I solved a few problems with the help of the Azure DevOps development team and I thought Iā€™d share my solutions. Hope they help.

ADO is generalized to be able to run any language youā€™d like, rather than being committed to a single language like HashiCorpā€™s Terraform Enterprise (Terraform only) and can drive your own machines already embedded in your infrastructure, rather than requiring you to use their hosts.

It also permits something many other CI/CDs do, which is writing our pipelines in YML format, and tracking and updating their config via the text YML config. This is powerful for several reasons:

  • As with every other DevOps resource, tracking state and changes in text and with pull requests allows peer review before changes and identification of changes afterward

--

--

Kyler Middleton
The Startup

DevNetSecOps, DevRel, cloud security chick. I will teach you, itā€™s unavoidable. She/Her šŸ³ļøā€šŸŒˆšŸ³ļøā€šŸŒˆ, INFJ-A, support the EFF!