Documente Academic
Documente Profesional
Documente Cultură
Setting up automated build and deployment for Windows service using Azure Pipeline
Introduction
This article helps you to understand how to setup automated build and deployment from GIT repository using Azure Pipeline. Build,
test, and deploy with CI/CD that works with any language, platform, and cloud. Connect to GitHub or any other Git provider and
deploy continuously.
https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/create-organization?view=vsts
Follow the above link to complete the organization setup and create the project. Once this step is completed, we are ready to setup
our first build pipeline.
https://www.codeproject.com/Articles/1266885/Deploying-Windows-Service-using-Azure-Pipeline?display=Print 1/10
06/12/2018 Deploying Windows Service using Azure Pipeline - CodeProject
New window will be opened to choose source branch, repository and the source branch for build. Select the options as below
according to your project.
Choose the .NET Desktop template since I can make use of most of the pre-defined pipeline steps which fit for my windows service
build, enter the name of the pipeline and choose any given Microsoft hosted agent or you can choose your own job (Default - No
agents). For this example, I am using the Microsoft hosted agent (Hosted VS2017) which is a good fit for my build. To understand
more about agent pools, click here.
https://www.codeproject.com/Articles/1266885/Deploying-Windows-Service-using-Azure-Pipeline?display=Print 2/10
06/12/2018 Deploying Windows Service using Azure Pipeline - CodeProject
.NET Desktop template has the list of build_pipeline5.JPG default jobs, for this project, I just leave with the default values for Nuget,
Nuget restore, Build solution and VsTest tasks. If you don't want any of these tasks, you can just select the specific task under the
agent and remove it.
Choose the Publish symbols path task and enter the details as below and leave the other fields with the default values.
Choose the Copy Files task and enter the information as below and leave the other fields with the default values.
https://www.codeproject.com/Articles/1266885/Deploying-Windows-Service-using-Azure-Pipeline?display=Print 3/10
06/12/2018 Deploying Windows Service using Azure Pipeline - CodeProject
Choose the Publish Artifact task, enter the information as below and leave the other fields with the default values.
Choose the trigger menu and select Enable continuous integration option and save it.
https://www.codeproject.com/Articles/1266885/Deploying-Windows-Service-using-Azure-Pipeline?display=Print 4/10
06/12/2018 Deploying Windows Service using Azure Pipeline - CodeProject
First build will be queued and started. Build is triggered and succeeded. Now we automated the build using Azure Pipeline.
Hereafter, whenever there is a change in the code, build will be triggered automatically.
1. Choose release pipeline -> New -> New release pipeline -> Select template -> Choose Empty Job
https://www.codeproject.com/Articles/1266885/Deploying-Windows-Service-using-Azure-Pipeline?display=Print 5/10
06/12/2018 Deploying Windows Service using Azure Pipeline - CodeProject
2. Select artifact task and fill in the information as below and click add. This is where we configure the build artifact as the
source for the release.
3. Enable the continuous release as below. It is applicable mostly for SIT/UAT environments. For production environment, it
will not be the case as we deploy based on schedules.
4. Select view stage tasks and add/modify the below tasks in sequence. Refer to the below screenshots. Select stage task and
add a deployment group job. Once added, select the deployment group job and update the information as below and leave
other fields with the default values.
https://www.codeproject.com/Articles/1266885/Deploying-Windows-Service-using-Azure-Pipeline?display=Print 6/10
06/12/2018 Deploying Windows Service using Azure Pipeline - CodeProject
6. Install WinRM File Copy task template from the market place and add this task by clicking Add a task to Agent job.
https://www.codeproject.com/Articles/1266885/Deploying-Windows-Service-using-Azure-Pipeline?display=Print 7/10
06/12/2018 Deploying Windows Service using Azure Pipeline - CodeProject
This SC commands helps to stop, delete, install and start the windows service in the Virtual Machine. You can modify the
scripts according to your needs.
8. Click Save and choose Release to start deploying the windows service to the target server.
Here you go! Successfully deployed the win service into the virtual machine.
https://www.codeproject.com/Articles/1266885/Deploying-Windows-Service-using-Azure-Pipeline?display=Print 8/10
06/12/2018 Deploying Windows Service using Azure Pipeline - CodeProject
Points of Interest
It's interesting when I started exploring Azure devops, it makes life easy :). Lot more to learn and make use of it in your projects.
This article makes you understand how to setting up the CI/CD pipeline. You can experiment other futures of Azure DevOps and
strengthen your DevOps skills .
License
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)
This member doesn't quite have enough reputation to be able to display their biography and homepage.
https://www.codeproject.com/Articles/1266885/Deploying-Windows-Service-using-Azure-Pipeline?display=Print 9/10
06/12/2018 Deploying Windows Service using Azure Pipeline - CodeProject
Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile Article Copyright 2018 by Prabakaran Rajendran
Web01 | 2.8.181205.1 | Last Updated 14 Nov 2018 Everything else Copyright © CodeProject, 1999-2018
https://www.codeproject.com/Articles/1266885/Deploying-Windows-Service-using-Azure-Pipeline?display=Print 10/10