{"id":8688,"date":"2022-03-08T20:37:15","date_gmt":"2022-03-09T01:37:15","guid":{"rendered":"https:\/\/www.rushworth.us\/lisa\/?p=8688"},"modified":"2022-03-11T20:41:58","modified_gmt":"2022-03-12T01:41:58","slug":"example-azure-devops-file-deployment","status":"publish","type":"post","link":"https:\/\/www.rushworth.us\/lisa\/?p=8688","title":{"rendered":"Example Azure DevOps File Deployment"},"content":{"rendered":"<p>To automatically update files from your repository on your server, use a release pipeline. For convenience, I use <em>deployment groups<\/em> to ensure all of the servers are updated.<\/p>\n<p><strong><em>Creating a deployment group<\/em><\/strong><\/p>\n<p>Under the Project, navigate to Pipelines and \u201cdeployment groups\u201d. Click \u201cNew\u201d and provide a name for the deployment group.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"773\" height=\"557\" class=\"wp-image-8735\" src=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-49.png\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-49.png 773w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-49-300x216.png 300w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-49-768x553.png 768w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-49-750x540.png 750w\" sizes=\"auto, (max-width: 773px) 100vw, 773px\" \/><\/p>\n<p>Now click into the deployment group and select \u201cRegister\u201d<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1299\" height=\"145\" class=\"wp-image-8736\" src=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-50.png\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-50.png 1299w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-50-300x33.png 300w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-50-1024x114.png 1024w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-50-768x86.png 768w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-50-750x84.png 750w\" sizes=\"auto, (max-width: 1299px) 100vw, 1299px\" \/><\/p>\n<p>Since I have a Linux server, I changed the \u201cType of target to register\u201d drop-down to \u201cLinux\u201d. Copy the command and run it on your server (I don\u2019t run <em>literally<\/em> what MS provides \u2013 I break it out into individual commands so I can make a folder named what I want it to be named and just run the part of the command that registers a service with systemctl.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"602\" height=\"523\" class=\"wp-image-8737\" src=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-51.png\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-51.png 602w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-51-300x261.png 300w\" sizes=\"auto, (max-width: 602px) 100vw, 602px\" \/><\/p>\n<p>Run the agent \u2013 for demonstration purposes, I am using the run.sh script to launch the agent. This outputs details to my console instead of a log file.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"502\" height=\"97\" class=\"wp-image-8738\" src=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-52.png\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-52.png 502w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-52-300x58.png 300w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-52-500x97.png 500w\" sizes=\"auto, (max-width: 502px) 100vw, 502px\" \/><\/p>\n<p>If you have multiple servers to which you want to deploy the files, install and run an agent on each one.<\/p>\n<p><strong><em>Create the release pipeline<\/em><\/strong><\/p>\n<p>Now we will build the pipeline that actually copies files over to the agent. Under Pipelines, navigate to \u201cReleases\u201d. Select \u201cNew\u201d and create a \u201cNew release pipeline\u201d. Start with an empty job.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"333\" height=\"190\" class=\"wp-image-8739\" src=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-53.png\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-53.png 333w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-53-300x171.png 300w\" sizes=\"auto, (max-width: 333px) 100vw, 333px\" \/><\/p>\n<p>You\u2019ll be asked to name the first stage of the deployment pipeline \u2013 here, I\u2019m calling it \u201cDeploy Files to Servers\u201d. Close out of the Stage window to see the pipeline.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"604\" height=\"334\" class=\"wp-image-8740\" src=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-54.png\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-54.png 604w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-54-300x166.png 300w\" sizes=\"auto, (max-width: 604px) 100vw, 604px\" \/><\/p>\n<p>Click the \u201c+ Add\u201d next to Artifacts to link an artifact to the deployment<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"240\" height=\"175\" class=\"wp-image-8741\" src=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-55.png\" \/><\/p>\n<p>If you have a build pipeline, you can link that as the artifact. Since I am just copying files, I selected the \u201cAzure Repo\u201d and configured the test project that contains the files I wish to deploy to my servers.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"607\" height=\"576\" class=\"wp-image-8742\" src=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-56.png\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-56.png 607w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-56-300x285.png 300w\" sizes=\"auto, (max-width: 607px) 100vw, 607px\" \/><\/p>\n<p>Click \u201cAdd\u201d<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"599\" height=\"402\" class=\"wp-image-8743\" src=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-57.png\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-57.png 599w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-57-300x201.png 300w\" sizes=\"auto, (max-width: 599px) 100vw, 599px\" \/><\/p>\n<p>Back in the pipeline, click the \u201c1 job, 0 task\u201d hyperlink to create a file deployment task.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"621\" height=\"416\" class=\"wp-image-8744\" src=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-58.png\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-58.png 621w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-58-300x201.png 300w\" sizes=\"auto, (max-width: 621px) 100vw, 621px\" \/><\/p>\n<p>We don\u2019t need the \u201cAgent job\u201d, so click on it and click \u201cRemove\u201d<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1074\" height=\"320\" class=\"wp-image-8745\" src=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-59.png\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-59.png 1074w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-59-300x89.png 300w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-59-1024x305.png 1024w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-59-768x229.png 768w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-59-750x223.png 750w\" sizes=\"auto, (max-width: 1074px) 100vw, 1074px\" \/><\/p>\n<p>Select the hamburger menu next to \u201cDeploy files to servers\u201d and select \u201cAdd a deployment group job\u201d<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"759\" height=\"331\" class=\"wp-image-8746\" src=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-60.png\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-60.png 759w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-60-300x131.png 300w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-60-750x327.png 750w\" sizes=\"auto, (max-width: 759px) 100vw, 759px\" \/><\/p>\n<p>Click the \u201cDeployment group\u201d dropdown and select the deployment group that contains the servers to which you want to deploy files. You can add tags to limit deployment to a subset of the deployment group \u2013 I don\u2019t do this, but I have seen instances where \u201cprod\u201d and \u201cdev\u201d tags were used and all servers in both the prod and dev environment were part of the same deployment group.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1082\" height=\"526\" class=\"wp-image-8747\" src=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-61.png\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-61.png 1082w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-61-300x146.png 300w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-61-1024x498.png 1024w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-61-768x373.png 768w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-61-750x365.png 750w\" sizes=\"auto, (max-width: 1082px) 100vw, 1082px\" \/><\/p>\n<p>Click the \u201c+\u201d on the \u201cDeployment group job\u201d item to add a task.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"559\" height=\"253\" class=\"wp-image-8748\" src=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-62.png\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-62.png 559w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-62-300x136.png 300w\" sizes=\"auto, (max-width: 559px) 100vw, 559px\" \/><\/p>\n<p>Find the \u201cCopy files\u201d task and click \u201cAdd\u201d to create a task to copy files.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1099\" height=\"512\" class=\"wp-image-8749\" src=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-63.png\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-63.png 1099w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-63-300x140.png 300w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-63-1024x477.png 1024w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-63-768x358.png 768w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-63-750x349.png 750w\" sizes=\"auto, (max-width: 1099px) 100vw, 1099px\" \/><\/p>\n<p>Click on the \u201cCopy files to:\u201d item to configure the task. The source folder is the Azure repo, and the target folder is the path on the server.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"519\" height=\"456\" class=\"wp-image-8750\" src=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-64.png\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-64.png 519w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-64-300x264.png 300w\" sizes=\"auto, (max-width: 519px) 100vw, 519px\" \/><\/p>\n<p>Click \u201cSave\u201d to save the task, then click \u201cOK\u201d to save the task.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"513\" height=\"323\" class=\"wp-image-8751\" src=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-65.png\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-65.png 513w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-65-300x189.png 300w\" sizes=\"auto, (max-width: 513px) 100vw, 513px\" \/><\/p>\n<p>Now create a release \u2013 click the \u201cCreate a release\u201d button<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"961\" height=\"560\" class=\"wp-image-8752\" src=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-66.png\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-66.png 961w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-66-300x175.png 300w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-66-768x448.png 768w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-66-750x437.png 750w\" sizes=\"auto, (max-width: 961px) 100vw, 961px\" \/><\/p>\n<p>ok<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"593\" height=\"598\" class=\"wp-image-8753\" src=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-67.png\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-67.png 593w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-67-297x300.png 297w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-67-150x150.png 150w\" sizes=\"auto, (max-width: 593px) 100vw, 593px\" \/><\/p>\n<p>When the deployment runs, the agent will show the job running.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"609\" height=\"130\" class=\"wp-image-8754\" src=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-68.png\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-68.png 609w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-68-300x64.png 300w\" sizes=\"auto, (max-width: 609px) 100vw, 609px\" \/><\/p>\n<p>Once the deployment completes, the files are on the server.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"506\" height=\"181\" class=\"wp-image-8755\" src=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-69.png\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-69.png 506w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-69-300x107.png 300w\" sizes=\"auto, (max-width: 506px) 100vw, 506px\" \/><\/p>\n<p><strong><em>Scheduling Release<\/em><\/strong><\/p>\n<p>In the pipeline, you can click on \u201cSchedule set\u201d to schedule new releases.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"648\" height=\"435\" class=\"wp-image-8756\" src=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-70.png\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-70.png 648w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-70-300x201.png 300w\" sizes=\"auto, (max-width: 648px) 100vw, 648px\" \/><\/p>\n<p>Enable the schedule, set a time \u2013 I select to only schedule the release if the source or pipeline has changed \u2026 if I\u2019ve not updated files in the repo, there\u2019s no need to redeploy the files. Remember to save your pipeline when you add the schedule.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"574\" height=\"383\" class=\"wp-image-8757\" src=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-71.png\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-71.png 574w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/word-image-71-300x200.png 300w\" sizes=\"auto, (max-width: 574px) 100vw, 574px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>To automatically update files from your repository on your server, use a release pipeline. For convenience, I use deployment groups to ensure all of the servers are updated. Creating a deployment group Under the Project, navigate to Pipelines and \u201cdeployment groups\u201d. Click \u201cNew\u201d and provide a name for the deployment group. Now click into the &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[33],"tags":[1091,1092,1554],"class_list":["post-8688","post","type-post","status-publish","format-standard","hentry","category-coding","tag-ado","tag-azure-devops","tag-deployment-pipeline"],"_links":{"self":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/8688","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=8688"}],"version-history":[{"count":1,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/8688\/revisions"}],"predecessor-version":[{"id":8758,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/8688\/revisions\/8758"}],"wp:attachment":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8688"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8688"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8688"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}