Visual Studio Team Services (VSTS): Continuous Integration (CI)

 

As a developer, it is good practice to use an online repository to store your project solution. One of the benefits of using an online repository is you will always have an online backup that you can access anytime, or if you’re working in a team, they can access it as long as they have the necessary permission.

But how can we ensure that the solution is not broken when somebody updated it? This is where the Continuous Integration (CI) of Visual Studio Team Services (VSTS) comes in, and this is what we will discuss in this blog post. For additional information regarding Continuous Integration, below is a screenshot take from Microsoft Visual Studio: What is Continuous Integration..

 

How to configure Visual Studio Team Services (VSTS) Continuous Integration (CI)

  1. Go to https://www.visualstudio.com/ team services and create new project.

  1. Open your Visual Studio, connect to your project and clone it.

  1. Create your baseline solution and commit it. For this post, I will be creating a Dynamics 365 Package with Plugin solution.

  1. Go to Visual Studio Team Services and verify the solution you’ve just checked in.

  1. Create a “Build Definition”. This will be the one responsible for your Continuous Integration.

  1. Start with an Empty Template, select “Hosted” as your Agent queue.

  1. Add “NuGet” and “MSBuild” task. NuGet will check and download for missing references while MSBuild will be doing the build on your project solution (just like “build/rebuild” in Visual Studio).

  1. On the “Triggers” tab, enable “Trigger Status”. Make sure that the type is “Include” and select the branch you are working on. With this, every time your branch gets updated, build gets triggered. You can configure to run this build on multiple branches like dev, test, UAT, prod, etc.

  1. Click on “Save & Queue” button to test your build.

  1. Now, every time you update, or one of your team members update the project solution, build is triggered (Continuous Integration) and members of the project will be notified if the build is a success or failure via email.

 

That’s it! That’s how easy it is to configure Continuous Integration (CI) of Visual Studio Team Services (VSTS). If you have questions or suggestions, just let me know on the comments box below!