Two weeks ago I went to a meetup where Donovan Brown spoke about DevOps, Continuous Delivery and Visual Studio Team Services.

You can take a look at a recorded session of his talk From 0 to DevOps:

I like the part in the beginning of the video where he talks about his definition:

DevOps is the union of people, process, and products to enable continuous delivery of value to our end users.

Donovan Brown

Back in 2008/2009 I was using TFS at work. It is nice to see how far Microsoft has come since then.

Visual Studio Team Services (VSTS) offers:

  • Planning
    • Agile
    • Scrum
  • Source control
    • Git
  • Build automation
  • Continuous deployment
  • Release management

You can sign up to VSTS for free and have unlimited private git repositories.

At work, I have been using products from different vendors to do the same thing:

  • Jira / Trello / Pivotal Tracker
  • GitHub / Bitbucket / GitLab
  • TeamCity / Jenkins
  • Octopus Deploy

Let’s set up a DevOps pipeline with VSTS, Azure, Continuous Integration and Continuous Delivery.

yo vsts

Update: The yo vsts project is no longer maintained. It has been superseded by yo Team, that handles both VSTS and TFS.

yo vsts is a Yeoman generator that creates a complete CI/CD pipeline in VSTS from the command line.

Automating the automation

Installation instructions:

To use it you need to have:

  • Visual Studio Team Services account
  • Azure Subscription

yo vsts

yo vsts

This will:

  • Create Team Project
    • Process template: Scrum
    • Version control: Git
  • Create Azure Service Endpoint
  • Create CI build definition
  • Create CD release definition
  • Clone the Git repo
  • Scaffold a ASP.NET Core project
    • with unit tests

Now all you have to do is push when ready

On the VSTS site the Git repo is empty:

VSTS Add some code

git push -u origin --all

git push -u origin --all

The code is now available on the VSTS site:

VSTS Code

The CI build definition:

VSTS Build Definition

The CD release definition:

VSTS Release Definition

We have releases for three environments on Azure:

  • Dev
  • QA
  • Prod

After a build we get feedback with Test Results and Code Coverage:

VSTS Build Summary

Release to Dev is done automatically after a push, but releases to QA and Prod needs manual approval:

VSTS Release Approval

When releases to all environments are done:

VSTS Release Summary

Then Azure looks like this:

Azure Resources

For all environment we have:

  • Application Insights
  • App Service plan
  • App Service

I’m running all this in the Free Pricing Tier.

LatestApi

I was trying out React before and built a simple site with a backend API. The code for the API was on GitHub and the API itself was hosted on Azure with continuous deployment enabled.

This whole blog post was just a reason to move the API from GitHub to Visual Studio Team Services and play with Continuous Delivery.

On VSTS the repos are private. So for you to view the code i mirrored the repo on GitHub:

git remote add github https://github.com/hlaueriksson/latest-api.git

git push -u github --all --force

Take a look at: https://github.com/hlaueriksson/latest-api