Continuous Build and Release with Microsoft Team Services — Getting Started

Vuong Le Phong
dtlpub
Published in
4 min readMay 8, 2017

My team at Digital Transformation Ltd are working on an exciting new project called Grub. The project includes a Swagger API written with .NET core and an Angular 2 Single Page Application (SPA). We are using Azure App Services to host both the API and the SPA web application. We are also using Microsoft Team Services source control and Scrum works.

Kasun Dilunika (https://medium.com/@dilunika) is one of our team’s tech gurus and an expert in many areas including Continuous Build, Continuous Integration (CI)and Continuous Delivery (CD). His suggestion was to use AWS Code Build, Code Deploy with Jenkin, and as a certified AWS Solution Architect myself, I agreed. The team already have several years of experience implementing similar solutions for our clients so I thought why not. However, we are also using Microsoft Azure for our development environment and more importantly, we are using Microsoft Team Services

I am confident that we would be able to achieve CI and CD using Team Services alone. So I began my exploration with Team Services.

Before

With the .NET core project, it is very straightforward to deploy the code to the Azure App Service from Visual Studio using Web Deploy.

For the Angular 2 app, we used FileZilla to copy files from the /dist folder to Azure.

More information can be found here:

https://docs.microsoft.com/en-us/azure/app-service-web/app-service-web-get-started-dotnet

https://social.technet.microsoft.com/wiki/contents/articles/34280.azure-how-to-upload-web-site-with-ftp.aspx

After

In the Azure Portal, under the DEPLOYMENT section of the App Service, there is a preview feature called Continuous Delivery.

The set-up is quite straightforward as described in this article: https://blogs.msdn.microsoft.com/visualstudioalm/2016/11/17/azure-app-services-continuous-delivery/

At the end of the process, a new Build and a new Release definition are created in Team Services.

.NET Core App
With the .NET Core project, there are a few things I need to do to make it work.

1. I had to add a Task to update the database with the latest Entity Framework code using the ef database update command.

2. The App Service must be stopped before the deployment and then started again after the deployment finishes.

3. Hosted VS2017 must be selected when queuing a new build.

Angular 2 app
With the Angular 2 app, there are a few additional steps.

  1. In the Build definition, npm must be installed on the build agent.

2. Angular/cli must be installed.

3. Run ng build to build the project.

4. The content of the /dist folder will be zipped into a zip file.

5. The zip file will be dropped to the drop location.

It’s straightforward to set up and it doesn’t need any additional servers and/or services. I’m not saying you should choose Microsoft Team Services over AWS Code Build, Code Deploy and Jenkin every time, as there will always be factors unique to your project. However, if you find yourself in a similar situation to ourselves, it might just be the right tool for the job.

That’s it for now.

www.digitaltransformation.co.nz

--

--

Vuong Le Phong
dtlpub
Writer for

An experienced Solutions Architect and Practice Lead who has had 15 years’ experience in the area of Solution Architecture, Design and Development.