Continuous Delivery with Visual Studio Team Services
Two weeks ago I went to a meetup where Donovan Brown spoke about DevOps, Continuous Delivery and Visual Studio Team Services.
Continuous Delivery for DevOps presented by @DonovanBrown pic.twitter.com/vdnCI7Er1R
— Henrik Lau Eriksson (@hlaueriksson) December 15, 2016
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.
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
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:
git push -u origin --all
The code is now available on the VSTS site:
The CI build definition:
The CD 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:
Release to Dev is done automatically after a push, but releases to QA and Prod needs manual approval:
When releases to all environments are done:
Then Azure looks like this:
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