Zero to DevOps

This is a write up of Donovan Brown’s VS Live 2016 Zero to DevOps. In this post i am gonna show you how to go from “zero to DevOps” like a pro with DEV, QA & PROD environments for ASP.NET MVC application that we’re gonna deploy to azure. I am gonna do in a resource group called “e2eDemo” on Azure.


1. Active Azure Account
2. VS 2015 ( Any edition )
3. VSTS Account

Let’s begin with a blank desktop as you can see nothing is running on my windows dev box as shown-


Will start by creating an VSTS account for this demo by navigating to as shown below-


Sign in to the portal using your Outlook, Hotmail etc and click on create new account. You should be able to see the below window-


Give a suitable name for your account and you could choose one of our source control repositories to manage your code. In my case i will be using Git. Post the creation, you’ll be redirected to your account dashboard as shown-


Go to the code hub, scroll down and if you want to create a readme file for your project you could pretty much do that as well.


Once created, you should see a readme file in your repo-


You can edit the file and do some changes just to give a valid name for your readme-


I have edited the first line and looks something like this-


Once saved, let’s try to setup a build definition. Click on the setup build at the top right corner-


A new popup would appear to select the build templates for you to define your build workflow. So lets go to the deployment hub and select Azure Web App since we would be deploying it to azure-


Select the repo and enable Continuous Integration. At this point you can set up your own private build agents or use the hosted agents provided by Microsoft. I would go with the hosted one at the moment-


You should see the build pipeline as shown-


Since we are embracing complete DevOps, we will remove the “Deploy” task from the build as we would be doing it from the release. Post which you should see as shown below-


Navigate to the “Test Assemblies” task and check code coverage-


Navigate to the options tab and check “create work item on failure” and select the “bug” as your WIT type. Since we are performing CI build, it has a tendency to fail. It’s good to have the WIT on failures so that it forces developers to go and fix particular issues-


At this moment let’s save our build definition as CI.

Navigate to work hub where we can plan. Create a PBI something like this-


Now let’s breakdown the PB to tasks which are individual items that we are gonna complete to turn the idea into a working piece of software-


Navigate to Kanban board,create 1 more task and re-order it by just dragging it to top-


You should be able to see the task 1st which you re-ordered. Move the PB from “New” to “Active” and the assigned to gets automatically assigned to yourself-


Now let’s branch from the work item so that we can have our isolation without polluting the other branches-


I have created a branch called “Init”-


Click on clone which brings you the tools that you can work with. Select Visual Studio and it should fire up you one-


You should see the VS with the repository cloned for you-


Go to the branches, expand remote origins and double click the “init” branch. At this moment you would have checked out your branch so that you can actually go and do your work in isolation. At the bottom right corner, you can see the branch you are currently checked out-


Navigate to Your Azure Portal to make sure that you don’t have a resource group at the moment-

23Click on new under solutions to create a new project-


Go to web and select ASP.NET template. Select your azure subscription at the right side and also configure application insights-


After clicking on configure settings for application insights, a pop up would appear. Fill the details as shown-


Click on OK and you should see this page. Select MVC, add unit tests at the bottom and also change authentication to “No authentication” as shown-


Once clicked, you will land at creation of App service plans, resource groups etc. Click on New to create a new resource group. Click new to create a new App service plan and click create. You should see something like this finally-


Once done, you should see a sample application being created from your visual studio-


Navigate to your azure portal to make sure you have the resource group along with couple of resources created and running for you. Add web-apps for QA and Prod. Click on add, select the webapp and give the name for your site. Repeat the steps for adding PROD site as well.Finally you should see all the websites ready for our deployment process under the resource group-


Let’s go and add webapps for QA and Prod. Click on add, select the webapp and give the name for your site. Repeat the steps for adding PROD site as well-

Now let’s put in the code so that we could have our build and deployment done. Go to the changes and commit and push the code-


At this moment you could see that we have pushed our code to the “init” branch which we had created earlier. But the CI build is in the master branch for which we gotta merge the code from init to master through pull request. Create a new pull request as shown-


You will be redirected to the web portal of your vsts account.


Click on “New pull request” and complete the pull request. You can give suggestions, add approvers and do lot more-


Next click on complete merge to complete the merge process from init to master branch. You can delete the init branch which was created earlier post the merging operation by simply selecting the checkbox at the bottom-


You should get the successful completion of pull request-


Navigate to the build hub to see the CI running-


You should see a successful build.


Note- If there were any failures in the build, then nothing to panic. Just go to solution, right click on “ApplicationInsights.config file” and “Add ignored files” then checkin to the repo. You should have a successful build and voila-

Now it’s time for the deployment and let’s create a release from the build summary itself as shown-


Upon clicking on create release from the bottom of the build summary, you will get a popup to choose the template. Select “Azure Website deployment” and click next-


Select the build definition and enable continuous deployment and click next-


You should see the release definition as shown-


Lets remove the “Run tests” task and configure Deploy website to azure task. Click on manage-


Add endpoint “Azure Resource Manager”. Provide a name and select the azure subscription that you wish to deploy-


In the task, select the subscription and app service name-


Let’s clone the environments for QA and prod. Click on the ellipse and clone-


You can set the approval workflow levels by adding yourself-


Repeat the steps for PROD environment as well.

Create a release, and you should be able to see the successful releases-


Login to the websites (DEV, QA and Prod) and you should be able to see the app running with the code deployed-


Also you can check the app insights in azure portal which was configured earlier-


Hope you enjoyed 🙂



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Create a free website or blog at

Up ↑

%d bloggers like this: