Setting up a DevOps demo using VSTS and Azure Part 3 of 5

As a TSP in DX at Microsoft, I am constantly asked to talk about DevOps and what DevOps means for Microsoft.  Although there are many definitions of DevOps floating out in our industry, at Microsoft, DevOps is the merging of people, process and products such that we can continually deliver value to our end users.  And clearly, VSTS/TFS and Azure are the products which enables this whole DevOps mindset.

Randy Pagels and I created a DevOps demo which show how VSTS/TFS and Azure  can do this.  For the next couple of blogs, I will walk you through how to set up our  DevOps demo using an asp.net website backed by sql server hosted in Azure.  Source control, work item tracking, CI builds and CD pipelines , unit tests, automated ui tests and load tests are all done using VSTS.

All artifacts for this blog series can be found here: https://github.com/abelsquidhead/MercuryHealth

Randy Pagels has written up the actual demo script we use with this demo environment.  You can read through the demo script here: http://www.teamsystemcafe.net/WhatsBrewing/Edit/38

Table Of Content

Part 1: Setting up your Azure PaaS Environment

Part 2: Setting up your VSTS Team Project

Part 3: Setting up your Git Repo

Part 4: Setting up your Build

Part 5: Setting up your Release Pipeline

Git Repo

This demo uses the git repo in VSTS as the pull request/code review workflow in the git is so much nicer than TFVC.  First we will upload the source code for this demo to our  git repo.  Then we will update the source code to use Application Insights.

Creating the git repo

The team project should have already been created with a git repo.

Uploading Code for the Demo

This walkthrough assumes that you already have git installed on your machine. If not,  you can download posh-git using chocolatey here

  1. Bring up a Windows PowerShell window box and browse to where you want your local git repo for this demo to be
  2. In your browser, click on the Code hub and click on the copy button to copy the Clone Url
  3. Go back to your command box and type git clone <paste the Clone Url>
  4. Enter your username and password
  5. Type dir and enter. You should see a new folder named MercuryHealth
  6. cd MercuryHealth
  7. Copy everything from the Repository directory you downloaded from GitHub to this directory
  8. Type dir. Your directory should now look like this
  9. git status
  10. If this is your first time setting up Git, you must set your account’s default identity.
    a. Git config –global user.email [email protected]
    b. Git config –global use.name “your name”
  11. git add *
  12. git commit -m “Initial checkin of project”
  13. git push
  14. Enter user name and password

Adding Instrumentation Key for Application Insights

  1. Browse to your Resource Group in the Azure Portal and select the ApplicationInsight resource
  2. Copy the App Insights Instrumentation Key
  3. Open up $/src/MercuryHealth.Web/ApplicationInsights.config with your favorite editor
  4. Paste your instrumentation key into ApplicationInsights.config
  5. Go back to the Azure Portal and select Getting Started
  6. Click on Monitor and Diagnose Client Side Application
  7. Copy the JavaScript snippet
  8. Open the file $/src/MercuryHealth.Web/Views/Shared/_Layout.cshtml in your favorite editor
  9. Past the JavaScript snippet here
  10. From the command box, type git status
  11. Type git add *
  12. Type git commit –m “Added application insight keys to the project”
  13. Type git push

 

Next up, part 4. Setting up up your Build