{"id":1963,"date":"2014-01-31T16:17:00","date_gmt":"2014-01-31T16:17:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/visualstudioalm\/2014\/01\/31\/how-to-modify-the-upgradetemplate-xaml-to-enable-releasing-from-a-build\/"},"modified":"2019-02-14T17:49:33","modified_gmt":"2019-02-15T01:49:33","slug":"how-to-modify-the-upgradetemplate-xaml-to-enable-releasing-from-a-build","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/devops\/how-to-modify-the-upgradetemplate-xaml-to-enable-releasing-from-a-build\/","title":{"rendered":"How to modify the UpgradeTemplate.xaml to enable releasing from a build"},"content":{"rendered":"<p>Release Management provides the option to trigger a release from a build. But to use this feature, some additional logic has to be added to the default build process template. You can refer to <a href=\"http:\/\/blogs.msdn.com\/b\/visualstudioalm\/archive\/2013\/12\/09\/how-to-modify-the-build-process-template-to-use-the-option-trigger-release-from-build.aspx\" target=\"_blank\">my previous post<\/a> on doing this with the default build process templates for <a title=\"Team Foundation Server\" href=\"http:\/\/msdn.microsoft.com\/en-us\/vstudio\/ff637362.aspx\" target=\"_blank\">TFS 2013<\/a>. This article details how to make the necessary modifications specifically for the <span style=\"font-family: Courier New\">UpgradeTemplate.xaml<\/span>.<\/p>\n<h2>If you are currently using the default UpgradeTemplate.xaml build process template<\/h2>\n<p>If you are using the default <span style=\"font-family: Courier New\">UpgradeTemplate.xaml<\/span> build process template all you need to do is use the corresponding <span style=\"font-family: Courier New\">ReleaseUpgradeTemplate.xaml<\/span> build process template.<\/p>\n<h2>If you are currently using a customized UpgradeTemplate.xaml build process template<\/h2>\n<p>If you have customized the default <span style=\"font-family: Courier New\">UpgradeTemplate.xaml<\/span> build process template, then you can use the snippets file (<span style=\"font-family: consolas\">ReleaseUpgradeTemplate.Snippets.xaml<\/span>) to help you integrate the release-specific customizations into your own custom <span style=\"font-family: Courier New\">UpgradeTemplate.xaml<\/span> build process template.<\/p>\n<h2>Modifying your own custom UpgradeTemplate.xaml build process template<\/h2>\n<p>The snippets file (<span style=\"font-family: consolas\">ReleaseUpgradeTemplate.Snippets.xaml<\/span>) only contains sections with start \/ end markers to indicate which parts to copy.<\/p>\n<p>The following is a sample section with start \/ end tags that is surrounded by some context.<\/p>\n<p><span style=\"font-family: consolas\">&lt;x:Members&gt; <br \/><span style=\"background-color: #ffffff\"><span style=\"background-color: #00ff00\">&nbsp; &lt;!&#8211; RM : START &ndash;&gt; <br \/><\/span><\/span><\/span><span style=\"font-family: consolas;background-color: #ffff00\">&nbsp;&nbsp;&nbsp; &lt;x:Property Name=&#8221;ConfigurationsToRelease&#8221; Type=&#8221;InArgument(s:String[])&#8221; \/&gt; <br \/>&nbsp;&nbsp;&nbsp; &lt;x:Property Name=&#8221;ReleaseBuild&#8221; Type=&#8221;InArgument(x:Boolean)&#8221; \/&gt; <br \/>&nbsp;&nbsp;&nbsp; &lt;x:Property Name=&#8221;ReleaseTargetStage&#8221; Type=&#8221;InArgument(x:String)&#8221; \/&gt; <br \/><\/span><span style=\"font-family: consolas\"><span style=\"background-color: #00ff00\">&nbsp; &lt;!&#8211; RM : END &#8211;&gt;<\/span> <br \/>&lt;\/x:Members&gt;<\/span><\/p>\n<p>Where <span style=\"font-family: consolas\">&lt;x:Members&gt; &#8230; &lt;\/x:Members&gt;<\/span><span style=\"font-family: calibri\"> indicate the context and everything between the start \/ end tags indicates what to copy as is (<span style=\"background-color: #ffff00\">yellow<\/span>).<\/span><\/p>\n<p>The only exception is the <span style=\"font-family: consolas\">Activity<\/span> element, where you will need to copy the attributes in the snippets file and add them to your custom build process template, without removing any existing attributes.<\/p>\n<p><span style=\"font-family: consolas\">&lt;Activity <span style=\"background-color: #ffff00\">this:Process.ReleaseBuild=&#8221;False&#8221; xmlns:mtc=&#8221;clr-namespace:Microsoft.TeamFoundation.Client;assembly=Microsoft.TeamFoundation.Client&#8221; xmlns:mw=&#8221;clr-namespace:Microsoft.Win32;assembly=mscorlib&#8221; xmlns:sco=&#8221;clr-namespace:System.Collections.ObjectModel;assembly=mscorlib&#8221;<\/span>&gt;<\/span><\/p>\n<h2>Using the ReleaseUpgradeTemplate.xaml build process template<\/h2>\n<p>Consider the following when using the <span style=\"font-family: Courier New\">ReleaseUpgradeTemplate.xaml<\/span> build process template.<\/p>\n<ol>\n<li>When using the functionality to automatically trigger Releases from a Build, you will need to install a Release Management client on your TFS Build Server. After installation, restart the TFS Build Services.<\/li>\n<li>While editing the Build Definition, Set the <strong>Release Build<\/strong> parameter to <strong>TRUE, <\/strong>to indicate that you want the build to be released.<\/li>\n<li>Specify the Target Stage for the Release in the <strong>Release Target Stage<\/strong> parameter. Leave blank to allow the Release to go through all the Stages defined in the Release Path. The check is case sensitive so make sure to match the name of the Target Stage verbatim.<\/li>\n<li>Ensure the Release Template is configured to match the Build Definition and the property <strong>Can Trigger a Release from a Build?<\/strong> is set.<\/li>\n<li>Specify which <strong>Configurations to Release<\/strong> (e.g. Debug, Release, etc.)<\/li>\n<\/ol>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/6\/2019\/02\/ReleaseUpgradeTemplate.zip\">ReleaseUpgradeTemplate.zip<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Release Management provides the option to trigger a release from a build. But to use this feature, some additional logic has to be added to the default build process template. You can refer to my previous post on doing this with the default build process templates for TFS 2013. This article details how to make [&hellip;]<\/p>\n","protected":false},"author":65,"featured_media":45953,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[253,226,1],"tags":[],"class_list":["post-1963","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-azure-devops-server","category-ci","category-devops"],"acf":[],"blog_post_summary":"<p>Release Management provides the option to trigger a release from a build. But to use this feature, some additional logic has to be added to the default build process template. You can refer to my previous post on doing this with the default build process templates for TFS 2013. This article details how to make [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/1963","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/users\/65"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/comments?post=1963"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/1963\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/media\/45953"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/media?parent=1963"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/categories?post=1963"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/tags?post=1963"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}