{"id":41425,"date":"2023-08-11T00:37:02","date_gmt":"2023-08-11T07:37:02","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/premier-developer\/?p=41425"},"modified":"2023-08-07T08:45:16","modified_gmt":"2023-08-07T15:45:16","slug":"azure-devops-pipelines-practices-for-scaling-templates","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/premier-developer\/azure-devops-pipelines-practices-for-scaling-templates\/","title":{"rendered":"Azure DevOps Pipelines: Practices for Scaling Templates"},"content":{"rendered":"<p><a href=\"https:\/\/www.linkedin.com\/in\/john-folberth\/\" target=\"_blank\" rel=\"noopener\">John Folberth<\/a> explores what is considered &#8220;good practices&#8221; when looking to leverage one repository consisting of YAML templates in this blog series.<\/p>\n<hr \/>\n<h2 id=\"toc-hId--1243737997\">Introduction<\/h2>\n<p>This article is part of a larger series on\u00a0<a href=\"https:\/\/techcommunity.microsoft.com\/t5\/healthcare-and-life-sciences\/bg-p\/HealthcareAndLifeSciencesBlog\/label-name\/YAML%20Pipeline%20Series\" target=\"_self\" rel=\"noopener\">Azure DevOps Pipelines regarding leveraging YAML templating<\/a>. As part of this series, I have had numerous requests or questions around what is considered &#8220;good practices&#8221; when looking to leverage one repository consisting of YAML templates.<\/p>\n<p>&nbsp;<\/p>\n<h2 id=\"toc-hId-1243774836\">Objective<\/h2>\n<p>The objective on what we are trying to achieve is create a structure by which we can create a task, job, stage, or variable template once and let all of our pipelines reuse the code. The intent is to achieve the following outcome:<\/p>\n<ul>\n<li>Reduce pipeline creation time<\/li>\n<li>Ease maintenance of pipelines<\/li>\n<li>Provide an extra layer of security on who can create pipelines<\/li>\n<li>Consistently be able to deploy various apps in a similar fashion<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h2 id=\"toc-hId--563679627\">Template Expansion<\/h2>\n<p>To best understand and architect a YAML pipeline via templates have to understand how the template expansion process works. When we go to run our Azure DevOps Pipeline it will collect all the YAML templates and associated files, variables, etc&#8230; and expand it into ONE file. This is the azure-pipeline-expanded.yml file which can be downloaded post a job completion. This is important to understand from architecture and troubleshooting perspective that we can see that one file is submitted to Azure DevOps. All parameters being passed in must be available at the pipeline compilation time. Runtime variables can be runtime variables and will be retrieved at pipeline execution.<\/p>\n<p>&nbsp;<\/p>\n<h2 id=\"toc-hId-1923833206\" class=\"lia-align-left\">One Repository<\/h2>\n<p>In order to help achieve these goals it is recommended to store of the templates in a dedicated Git repository. Azure DevOps pipelines support this functionality via the\u00a0<a href=\"https:\/\/learn.microsoft.com\/en-us\/azure\/devops\/pipelines\/process\/resources?view=azure-devops&amp;tabs=schema\" target=\"_self\" rel=\"noopener noreferrer\">resources block<\/a>. By doing this all of our pipelines can retrieve their templates from one consolidate location. In addition, by putting these in a separate repository we can introduce another layer of security on who can update this repo.<\/p>\n<p>Continue to <a href=\"https:\/\/techcommunity.microsoft.com\/t5\/healthcare-and-life-sciences\/azure-devops-pipelines-practices-for-scaling-templates\/ba-p\/3855524\">John&#8217;s full post here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>John Folberth explores what is considered &#8220;good practices&#8221; when looking to leverage one repository consisting of YAML templates in this blog series. Introduction This article is part of a larger series on\u00a0Azure DevOps Pipelines regarding leveraging YAML templating. As part of this series, I have had numerous requests or questions around what is considered &#8220;good [&hellip;]<\/p>\n","protected":false},"author":582,"featured_media":41426,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[22],"tags":[2571],"class_list":["post-41425","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-devops","tag-azure-devops"],"acf":[],"blog_post_summary":"<p>John Folberth explores what is considered &#8220;good practices&#8221; when looking to leverage one repository consisting of YAML templates in this blog series. Introduction This article is part of a larger series on\u00a0Azure DevOps Pipelines regarding leveraging YAML templating. As part of this series, I have had numerous requests or questions around what is considered &#8220;good [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts\/41425","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/users\/582"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/comments?post=41425"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts\/41425\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/media\/41426"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/media?parent=41425"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/categories?post=41425"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/tags?post=41425"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}