NodeJS, Java and .NET Build Automation with VSTS (VSO, TFS)

December 6, 2015 TFS, Videos , , , , ,

Have you tried Visual Studio Online (or Visual Studio Team Services, as it is now called) for build automation? VSTS (TFS 2015) has a new and much powerful build engine than TFS 2013 and you can now configure build automation for NodeJS, Java, Android, XCode and .NET.

The video recording below is a quick guide to configure Cross Platform Build Automation with VSTS or TFS 2015 (on-prem)


Direct Link:–TFS-2015

1Gig-Tech #1 – Azure, SignalR, Win10, Redis, DevOps, HTML5

July 5, 2015 1Gig Tech , , , , ,

Welcome to 1Gig Tech for 05 Jul, 2015!

In today’s edition, there are 20 articles on technology, news, open source, community on the fantastic and ever evolving technology world.

  • Code Presenter Pro
    Code Presenter Pro focuses on providing a solution for more efficient presentation.
    Read more
  • How to install Microsoft Visual Studio Code in Ubuntu, Linux Mint, elementary os Freya ……… by Polihron Alexandru
    sudo apt-add-repository ppa:ubuntu-desktop/ubuntu-make sudo apt-get update sudo apt-get install ubuntu-make umake web visual-studio-code
    Read more
  • Free ebook: Microsoft Azure Essentials: Azure Web Apps for Developers by Rick Rainey. This
    Download all formats (PDF, Mobi and ePub) at the Microsoft Virtual Academy. Below you’ll find the ebook’s Foreword, by Scott Guthrie, Executive Vice President of the Cloud and Enterprise group at Microsoft, as well as a few helpful sections from its Introduction. Enjoy!
    Read more
  • Microsoft/Windows-universal-samples by corywink
    This repo contains the samples that demonstrate the API usage patterns for the Universal Windows Platform (UWP) in the Windows Software Development Kit (SDK) for Windows 10. These code samples are designed to run on both desktop, mobile and future devices that support the Universal Windows Platform.
    Read more
  • VM Depot : Image Minecraft out-a-box server
    Categories: Application Stack Language Stack
    Read more
  • Update WebGrid on Clients Without Postback using SignalR by Shashank S Chandel
    Till now, everyone has used a gridview to bind data on postbacks. Here, we make it dynamic using SiganlR to update columns on each client where the gridview is displayed without postback or any server side operation. SiganlR and JQuery will make this possible.
    Read more
  • Microsoft Mico: See the first Windows 11 Mobile Concept by Surur
    Windows 10 Mobile has not even launched yet, but that does not mean futuristic concept designers can not imagineer the next version of the OS already.
    Read more
  • Refactoring with Loops and Collection Pipelines by Martin Fowler
    The loop is the classic way of processing collections, but with the greater adoption of first-class functions in programming languages the collection pipeline is an appealing alternative. In this article I look at refactoring loops to collection pipelines with a series of small examples.
    Read more
  • Don’t like white title bars on Windows 10? Here’s how to get colored title bars! by Mehedi Hassan
    Windows 10 comes with a lot of new features and improvements. One of the most controversial new change is the title bars – Microsoft has made the title bars white which a lot of users like while some don’t.
    Read more
  • Intro to Redis for .NET Developers
    Redis (REmote DIctionay Server) is a very popular open-source, networked, in-memory, key-value data store, sometimes referred to as a data structure server which also comes with optional durability.
    Read more
  • Moving to HTML5 Premium Media by Microsoft Edge Team
    The commercial media industry is undergoing a major transition as content providers move away from proprietary web plug-in based delivery mechanisms (such as Flash or Silverlight), and replace them with unified plug-in free video players that are based on HTML5 specifications and commercial media e
    Read more
  • DevOps: Continuous Delivery using Visual Studio Online and Azure.
    The session outlines the best of cloud world – ALM and Continuous Delivery into Azure platform. The session will focus on configuring VSO, developing applications using VS2015 and running continuous integration (unit tests) and auto deploying the code to Azure Staging and Production platforms.
    Read more
  • Create your temporary Azure App Service app
    Free trial Create your temporary Azure App Service app 1) Select your App Service 2) Select a template and create your web app Change language: Create 3) Work with your web app for an hour, or sign up for a trial and stay for a month! Manage in Azure Porta
    Read more
  • Xamarin Test Cloud Now Available to All Xamarin Developers by Steven Yi
    We started Xamarin because we want to help developers build apps they can be proud of and provide you with the tools you need to ensure that your apps do what they were designed to do. A user’s perspective about you or your business is greatly impacted by your mobile app.
    Read more
  • Working Toward Universal Interoperability in IoT by Steve Teixeira
    Today’s Internet of Things landscape is a modern day Tower of Babel – a proliferation of communication protocols and data formats across the device ecosystem that make it difficult for devices to “speak the same language” and work together in harmony.
    Read more
  • Microsoft Announces Azure Authenticator App For iOS, Android And Windows Devices by pradeep
    Microsoft recently released a new version of the Azure Authenticator that replaces the Multi-Factor Authentication app published by PhoneFactor. Azure Authenticator can be the single application you need for all your multi-factor authentication needs.
    Read more
  • Meet Microsoft’s Maker.js, A JavaScript Library For Creating Drawings For CNC And Laser Cutters by pradeep
    Maker.js is a new Microsoft Garage project. It is an open source JavaScript library for creating drawings for CNC and laser cutters. Drawings are small JavaScript programs which can be reused in other drawings, creating a network effect. Maker.
    Read more
  • 650+ Free controls and frameworks for .NET (Windows Forms, WPF, ASP.NET MVC, ASP.NET Web Forms, LightSwitch, Silverlight, Windows Phone, WinRT, Windows 8), iOS, Android, Xamarin and JavaScript platforms
    Who is eligible? Individual developers or up to five users at companies with annual gross revenue below $1 million USD.
    Read more
  • Windows 10 is coming…here’s what to tell non-technical parent by Scott Hanselman
    Windows 10 is coming on July 29th! I’ve been doing Build to Build videos on my YouTube showing what’s changing and how it will affect you. I got a request to do a video showing Windows 7, Windows 8, and Windows 10 and how to reserve your upgrade, as well as a little demo of the Start Screen.
    Read more
  • Paged List for WebAPI by Tom DuPont
    One of my favorite quotes is “there is nothing as embarrassing as yesterday’s code.” I blogged about a paged list class a while back, but I no longer like that implementation…so here is a new one that includes WebAPI serialization support!
    Read more

You can also follow these updates on Facebook Page or can also read previous editions at 1Gig Tech


Channel9 – DevOps: Continuous Delivery using Visual Studio Online and Azure

June 22, 2015 Azure, Sessions, TFS, Videos, Visual Studio , , , , ,

I am glad to say that my webcast, that I delivered as part of Southeast Asia MVP ComCamp 2015, has been published on MSDN Channel9 

The session outlines the best of cloud world – ALM and Continuous Delivery into Azure platform.  The session will focus on configuring VSO, developing applications using VS2015 and running continuous integration (unit tests) and auto deploying the code to Azure Staging and Production platforms.

Direct link:



Continuous Delivery with Visual Studio Online and Azure

June 18, 2014 Sessions , , , ,

On June 26th 2014, I will be delivering a talk on Continuous Delivery with Visual Studio Online and Azure for a Brazil User Group. This will be a webcast for 1 hour and its agenda would be as outlined below. This webcast is a must for those interested in understanding Visual Studio Online and its ALM features that can be used to have a Continuous Delivery into Azure (cloud) platform. Agenda:

  • Introduction to Visual Studio Online and its features
  • ALM – Requirements Gathering, Construction, Unit Testing
  • Continuous Delivery – Build Automation and Deployment
  • Q&A

The webcast will be tailored considering how both Visual Studio Online (or its on-premise version) and Azure can be best used for enterprises to achieve efficiency and maturity in their product life cycle.

For any questions, you can contact me over twitter: @ganshani

or you can also contact Jucinei Santos (the organizer of this webcast)

To register for this webcast, please visit

Webinar – DevOps: Continuous Integration with TFS

April 28, 2014 ALM, Sessions, TFS , ,

Speaker: Punit Ganshani
Topic: DevOps: Continuous Integration with TFS
Date & Venue:  May 07, 2014 (Wednesday) at 6:00 PM to 6:45 PM (SGT)
Venue: Online (Lync Meeting)

What are we going to cover? This is what you can get!
Team Foundation server
  • Our MVP will share about what’s new in TFS 2013
  • DevOps – Continuous Integration and Deployment using TFS 2013
  • TFS best practices
Questions and Answers Ask the MVP

Use this opportunity to our MVP and the Microsoft team your toughest question on Team Foundation Server 2013!

Register below or at


Team Foundation Server : Disable Work Item to be marked as Resolved

February 15, 2014 ALM, TFS, Visual Studio , ,

When you check-in a code change using Team Explorer in Visual Studio, you can associate the check-in with one or more work items.

As shown in the snapshot below, the default option that appears against each work-item is ‘Resolve’.  What this means is that when you check-in the changes, the work item status will be changed from Active to Closed.  This also means that you can check-in code later to the same work item, but it’s status will not change.


Now, this can be really tricky if you are using TFS for ALM purposes.  You would want to give a right picture to your Team Leads, Scrum Masters and Managers.  So you would want to change the default to Associate.  This can be done by a simple registry tweak


I am using Visual Studio 2013, hence the folder is


Value of Key ResolveAsDefaultCheckinAction needs to be set to False instead of True

For other versions of Visual Studio, you will have to replace 12.0 with appropriate version in the folder name

Team Foundation Server : Build Logging

January 9, 2014 ALM, TFS, Visual Studio , , , ,

When you use Team Foundation Server for Build Automation, you can configure build controller and agents.  In the Team Foundation Administration Console, you can view the Logs however these logs provide minimal information.  Even the Event Viewer provides minimal event logging rather than extensive logging.  Now even if these Logs or Event Viewer provide you information that you require, there may be cases that you do not have complete access to the build server and this build server is managed by your organization’s support groups.

In this case, you can enable detailed level logs of build service so that you can read the logs in Read Only mode without having to login to the server.  Note that this log file will have build information of all agents running on the controller and not specific to an agent.  So if you are using a Shared Build Controller, everyone with access to this log file will have information about your builds too.

To get started, you need to manually create a configuration file with following content,

  1. <configuration>
  2.     <system.diagnostics>
  3.         <switches>
  4.             <add name="BuildServiceTraceLevel" value="4"/>
  5.         </switches>
  6.         <trace autoflush="true" indentsize="4">
  7.             <listeners>
  8.                 <add name="myListener" type="Microsoft.TeamFoundation.TeamFoundationTextWriterTraceListener,Microsoft.TeamFoundation.Common, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" initializeData="c:\Build\TFSBuildlogs\TFSBuildServiceHost.exe.log" />
  9.          <remove name="Default" />
  10.             </listeners>
  11.         </trace>
  12.     </system.diagnostics>
  13. </configuration>


Name this file as TFSBuildServiceHost.exe.config

You can customize this configuration file by adding more trace listeners or even changing the location of build log file from C:\Build\TFSBuildlogs (create if it does not exist).  If you are sharing this path with multiple teams, please make sure you only give Read Only rights to all parties.

As the name suggests, this is a configuration file for TFSBuildServiceHost.exe.  On your build server, you can locate this executable at –

%programfiles%\Microsoft Team Foundation Server 2010\Tools

You can copy this file in the above path.  If you are using Windows Server 2008/2012, it will validate your Administrative Privileges with UAC.

Ensure that no builds are in active state.  Start the Command Prompt with ‘Run As Administrator’ privileges and execute these commands

net stop tfsbuildservicehost
net start tfsbuildservicehost

This will restart the TFSBuildServiceHost service and voila! The log files will detailed logging will be created at C:\Build\TFSBuildlogs

Note: This has been tested on TFS 2012 / 2013.  I’ve not tested this on older versions of TFS.

Team Foundation Server : Build Automation

November 25, 2013 ALM, TFS, Visual Studio , , , ,

This article will focus on achieving build automation using TFS.  However, if you want to understand the architecture, configuration, project creation, product backlog, managing SPRINT and releases etc. you can go through these articles

All the examples, referred below, use Team Foundation Service (cloud-based TFS).  Some of the settings may be overridden by your TFS Administrator if you are using TFS on-premise (in your organization).


What is build automation and do I really need it?

Build automation as the word implies means automating the build process.  But the build automation does not end at compiling your code.  It encompasses several tasks such as

  • compiling source code (taken directly from a repository, here TFS)
  • packaging into binary code
  • running tests (optional)
  • deployment of binary code to production environment (optional)

When your team size is small (1-2 developers), you can compile the code on your machine to verify the accuracy of your and probably your team’s code.  But in large teams, it becomes essential that only code checked-in is the code that compiles and quality of code is not compromised.  This indirectly saves time and cost for the organizations.  Build automation allows you to configure set of schedules and processes to ensure that the above objectives are met.  You can have your code built on demand, or schedule it at a particular time (nightly-builds, incremental builds, etc.) or have gated-build to be triggered when any check-in is done.

Scheduled and gated-builds are examples of Continuous Integration (CI)

What build automation does not guarantee?

Bug-free code.  It ensures that your code compiles but does not ensure that your code is bug-free

How do we achieve Build Automation with TFS?

Build automation in TFS is achieved by running automated MSBuild scripts for your projects.  Generation of scripts for most of the common tasks is automated and you need to write script for only uncommon, complex tasks.  So let’s first see how to configure the common tasks

As a first step, you need to connect to a Team Foundation Server.  In this example, I am connected to my CInject repository.  Once you are connected to Team Foundation Server, you can go to your Team Explorer window in Visual Studio.


You can click on Builds and then on New Build Definition


If you do not have sufficient privileges to create build definition, you will get an error message (as below).  You can request your TFS Admin to grant you build rights (ManageBuildResources).


When the New Build Definition dialog opens, follow through these steps.  You need to create this definition once and all your team members will be able to view them.


On the General tab, choose a build definition name.  As a best practice, the build definition name should depict nature of build (nightly, gated), environment and application name

On Trigger tab, you will have following options

  • Manual – As the name suggests, you can trigger manual builds on the build server
  • Continuous Integration – Trigger a build when code is check-in
  • Rolling Builds – Trigger a build at every X minutes
  • Gated check-in – Trigger a build before check-in.  This ensures that only error-free code gets checked-in
  • Schedule – Schedule a build at a particular time of a day

On Source Settings tab, you can choose the working folders.  It is advisable to choose the closest branch in which the code resides as a working folder.

On Build Defaults tab, you can define your build controller and staging locations

  • When using Team Foundation as Service (cloud-based TFS), the build controller will have only one value in the drop down ‘Hosted Build Controller’. When using Team Foundation Server (on-premises), you will have to configure a build controller for yourself.  We will deal with building your own build controller in a separate article.
  • For staging locations, you can have the build output checked in to TFS directly or to a shared drive, or ignore the build output. 

    If you are staging it to a shared drive you need to make sure that the Service Account / Active Directory Account through which the build service is running on the build server has Full Control on the shared location

On Process tab, you can define your own build process.  We will deal with the customization of process template in a different article.  When using Team Foundation as Service (cloud-based TFS), you will have following templates

  • Default Template
  • Upgrade Template – When upgrading from older version of TFS
  • Azure Continuous Deployment – Build and deploy websites and services to Azure Cloud platform. Read more
  • Tfvc Template – Team Foundation Version Control template
  • Git Template – GIT version control template

Each template will give you different options to configure.  Some of the common options are

  • Version Control – Clean Workspace, Get Version, Label Sources
  • Build –
    • Projects – You can select solution file or individual projects that need to be built
    • Configurations – You can select a configuration and platform here.  The configuration selected here should be available under Configuration Manager of your solution otherwise the build will fail.  This can also be useful when you have configuration transforms for app.config / web.config files
    • Output Location – In TFS 2010, the build output of all the selected projects was always copied to a single folder.  With TFS 2012+, you can choose of the options – single folder, per project, or as configured in individual projects.
    • Advanced – This setting allows you to pass additional parameters to MSBuild, configure pre-build and post-build scripts and enable/disable code analysis.  For the uncommon complex tasks you can check-in your pre-build and post-build scripts in TFS and change the settings in Advanced section.  You can also choose to run FxCop to perform code analysis on your projects
  • Test – You can configure your test projects here.  By default, MSTest will be used as engine for unit-testing.  If you want to disable unit-test runs, you can set Disable Tests to true
  • Advanced -  Advanced allows you to configure your build agents and post-build behaviour. If you want to create a Build Bug for every failed build, or want to update Work Items with the build number, you can set it up in this setting

On Retention Policy tab, you can define how long you would want to retain build outcome. In your organization, this may be driven by some audit/compliance requirements or by best practices.

Once you have configured the build definition, you can view the build definitions in the same Team Explorer


You can Queue New Build, Edit Build Definition or even View Controller Queue from Team Explorer.  Any on-going build will be visible under ‘My Builds’.  You can double click on an on-going build to view its status.  With large teams, you can use Build Notifications tool that minimizes itself to system tray and pops-up with build notifications such as Build Triggered, Started, Completed, Failed.  This is very handy specially when you have large teams spread across geographies.

Hope this helps in understanding the process of creating a build with TFS.

Team Foundation Server : Understanding the Architecture

November 23, 2013 ALM, TFS, Visual Studio , , , ,

This article will briefly describe the high-level architecture of Team Foundation Server.  It will help you understand the different tiers in TFS, their responsibilities and firewalls.

Heard of TFS as a Service, what is it?

TFS as a Service is a cloud-based application life management (ALM) system that integrates source control management, product backlog, build automation, quality and deployment and encourages team collaboration to achieve efficiency in following processes.  In its free service offering, you can register on for an account and get started.  All the infrastructure (all tiers) is pre-configured on an elastic-cloud owned by Microsoft.  As a consumer, you would be provided with services without having to go through the configuration part of TFS.

But we are not allowed to upload our code to public clouds in my organization?

If you are working in an enterprise with restricted environment, chances are that you have your infrastructure on which TFS has been installed.  This is to have enhanced security and sometimes to comply to the laws of the nation where the data resides.

Now in this case, you will have to configure the Team Foundation Server on your own and hopefully this article will serve as a good start.


TFS is primarily structured into 3 layers. 

  • Data Tier – TFS uses SQL Server as its data storage
  • Application Tier – The application tier consists of
    • TFS Server – Typically a Windows Server 2008/2012
    • Team Foundation Web Services  -  These web services (http/https) act as a facade for TFS clients.  They exchange data with their clients using Client Object Model.
    • Server Object Model – Data exchange between TFS Server and the SQL Server (may be on a different VM/physical box) happens using Server Object Model.
  • Build Tier – The build tier consists of
    • Build Service – The build service (ASP.NET Worker Process) contains of Build Controllers and Build Agents
    • Build Process Object Model – The process object model contains of the process workflow that has to be followed when defining the build definition
    • Client Object Model – Client Object Model is the data exchange between TFS Server (Application Tier) and Build Service

It is important to understand that the application tier referred above is the application tier of TFS and not your business application.  Based on several factors such as geographical spread, server-load, network topology, proxies, etc. you may have one or multiple servers in application tier.  You can configure the build tier on the server forming the application tier.  Some deployment scenarios prefer configuring one build server for multiple TFS servers.


A TFS Server can hold more than one code-repository and have isolated & customized build process(es) set up on one or multiple build servers.

Let’s understand this with an example –

Your TFS server url is This TFS Server can host multiple TFS Projects say ProjectA, ProjectB and ProjectC.  Each project has a code repository say RepositoryA, RepositoryB, RepositoryC and each repository has 4 branches – Development, SIT, UAT, PROD.  The code in the repositories resides on the Data Tier and is accessible using client applications that interface through the Application Tier.

Now, for each branch you can configure one or multiple build processes.  For PROD, you may like to have Nightly Builds, for Development you want to have a build triggered at every check-in and so on…  These builds require a build server.  You can use 1 build server for all the builds or you can have a separate build server for each Repository, or you can share build server between 2 repositories.

The decision to use one-build server or more depends on the peak-load, expected build queue, h/w infrastructure and a lot of other parameters.  If you do not want build services, you do not need to configure a build server at all.

With this understanding, we will deep dive into the responsibilities of each tier

Data Tier

Data Tier is formed of a SQL Server running on a Windows Server VM/physical machine.

A SQL Server consists of following databases

  • TFS_Configuration  – Configuration Database that stores the TFS resources and settings
  • TFS_Warehouse  – Data warehouse database for report generation
  • TFS_Analysis – Aggregated data of all Projects on a TFS server
  • Project databases – Database for each Project in the collection

In TFS 2013, you may see some additional databases (with names starting with WSS) that are required to manage the TFS Administration Portal.  This administration portal runs on SharePoint Foundation.

Application Tier

The application tier consists of components such as

  • Version Control – Source code versioning & management
  • Build Service – Light-weight ASP.NET Worker Process that interacts with the Build Tier
  • Work Item Tracking – Product backlog, bug, work-item tracking & management
  • Team Foundation Framework Services – Web services, Registry, Security, Event, Identity Management, Administration
  • Administration Portal – Built on SharePoint Foundation, the portal serves as one-stop for defining projects, team, work-items, reports, permissions, etc.

All these components are hosted on IIS and Windows Services on a Windows Server VM/machine.  The Team Foundation Framework Services act as a facade for all client tools like TFS Explorer, Visual Studio, etc.

Build Tier

Build tier consists of build services that enable configuring a build controller and build agents.  A build controller controls the build queue and assigns the responsibility of build to a most available build agent.  If no build agent is free, it will queue the build request.

It is not necessary to have the controller and agent on the same machine.  This allows creating a build farm that can have multiple build machines.  One of the scenarios for an enterprise build environment would be

A build farm with S servers on which C (C<S) controllers are running and A (A>S>C) build agents are running. In such a scenario, the likely hood of a build getting queued for a long duration is rare.  However, actual values of A, S, C depend on number of applications, peak-load, build time, locale, infrastructure costs, cross-border restrictions, etc.


TFS architecture has been designed to allow extensibility and building a large farm at data-tier, application-tier or build-tier.  When configuring TFS on a farm, the inter-server communication happens through web services.  In an enterprise environment with high-security, you may have to check if any of the ports used in web service communication is blocked.

By default TFS uses following ports

  • Team Foundation Administration Portal and Reporting – port 80, 443
  • Team Foundation Client Web Services – port 8080
  • MS-SQL – port 1433 (TCP)
  • Team Foundation Application Tier Web Services – port 8080
  • Team Foundation Data Tier Web Services – port 8080
  • Build Services – net.pipe, 9191, 443


Hope this helps in understanding TFS architecture.

Team Foundation Server : Managing Sprint and Releases

March 15, 2013 ALM, TFS, Visual Studio , , , , ,

This is continued from the series of articles on TFS.  I would recommend you reading two articles if you are new to TFS

So I am assuming that you have a project created and a Product Backlog created in your TFS website.  So when you click on Work menu, so see a menu at the left with Current Sprint 1 and some Future Sprint x.


Now this is not what you would always what.  The number of Sprint is different for each project and you might want to customize it.  So to customize that click on the right most option in the top-menu


This will bring you to a Project Profile page which has a different top-menu as shown below


Click on iterations menu to view all the Sprints.  Hover over Sprint 1 and click on Set Dates and set a start date and an end date.  You can also give a meaningful name to Sprint 1 but for these tutorials and for ease of understanding I will not change the name.

Click on Save and Close to save the changes


Un-tick the Sprint that are not applicable to your project


This way you can configure Sprint and Releases for your project using TFS.

Follow on Feedly