Microsoft Team Foundation Server 2015 Cookbook - Tarun Arora - E-Book

Microsoft Team Foundation Server 2015 Cookbook E-Book

Tarun Arora

0,0
43,19 €

-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.

Mehr erfahren.
Beschreibung

Over 80 hands-on DevOps and ALM-focused recipes for Scrum Teams to enable the Continuous Delivery of high-quality Software... Faster!

About This Book

  • Release high quality, reliable software quickly through building, testing, and deployment automation
  • Improve the predictability, reliability, and availability of TFS in your organization by scheduling administration and maintenance activities
  • Extend, customize, and integrate tools with TFS, enabling your teams to manage their application lifecycles effectively

Who This Book Is For

This book is aimed at software professionals including Developers, Testers, Architects, Configuration Analysts, and Release Managers who want to understand the capabilities of TFS to deliver better quality software faster.

A working setup of TFS 2015 and some familiarity with the concepts of software life cycle management is assumed.

What You Will Learn

  • Creating a Team Project with Dashboards, Assigning License, Adding users, and Auditing Access
  • Setting up a Git repository in an existing TFVC-based Team Project
  • Setting up branch policies and conducting Pull requests with code reviews
  • Mapping, assigning and tracking work items shared by multiple teams
  • Setting up and customizing Backlogs, Kanban board, Sprint Taskboard, and dashboards
  • Creating a Continuous Integration, Continuous Build, and Release Pipeline
  • Integrating SonarQube with TFBuild to manage Technical Debt
  • Triggering Selenium Web Tests on a Selenium Test Grid using TFBuild
  • Using Visual Studio Team Services Cloud load testing capability with new Build framework
  • Extending and customizing the capabilities of Team Foundation Server using API and Process Editor

In Detail

Team Foundation Server (TFS) allows you to manage code repositories, build processes, test infrastructure, and deploy labs. TFS supports your team, enabling you to connect, collaborate, and deliver on time. Microsoft's approach to Application Lifecycle Management (ALM) provides a flexible and agile environment that adapts to the needs of your team, removes barriers between roles, and streamlines processes.

The book introduces you to creating and setting up team projects for scrum teams. You'll explore various source control repositories, branching, and merging activities, along with a demonstration of how to embed quality into every code check-in. Then, you'll discover agile project planning and management tools. Later, emphasis is given to the testing and release management features of TFS which facilitate the automation of the release pipeline in order to create potentially shippable increments.

By the end of the book, you'll have learned to extend and customize TFS plugins to incorporate them into other platforms and enable teams to manage the software lifecycle effectively.

Style and approach

This book is a recipe-based guide that uses a problem-solution format to call out inefficiencies in the software development lifecycle and then guides you, step-by-step, on how you can use Team Foundation Server to your advantage in those areas.

Sie lesen das E-Book in den Legimi-Apps auf:

Android
iOS
von Legimi
zertifizierten E-Readern

Seitenzahl: 371

Veröffentlichungsjahr: 2016

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



Table of Contents

Microsoft Team Foundation Server 2015 Cookbook
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Instant updates on new Packt books
Preface
What this book covers
What you need for this book
Who this book is for
Sections
Getting ready
How to do it…
How it works…
There's more…
See also
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Team Project Setup
Introduction
Connecting to TFS using Team Explorer
Getting ready
How to do it...
How it works...
Setting up your user profile in TFS
How to do it…
How it works…
Creating a Team Project using the Scrum Template
Getting ready
How to do it...
How it works...
Assigning a license, adding users, and auditing user access
Getting ready
How to do it...
Assigning a user license:
Adding users to the project:
Auditing user access
How it works...
Configuring Dashboards in Team Project
Getting ready
How to do it…
How it works…
Setting up a welcome page for a Team Project
Getting ready
How to do it…
How it works…
Creating and setting up a Team Room
Getting ready
How to do it...
How it works...
There's more...
Renaming a Team Project
Getting ready
How to do it...
Option 1
Option 2
How it works...
Creating a new Team Project through the command line
Getting ready
How to do it...
How it works...
There's more...
Deleting a Team Project
Getting ready
How to do it...
Option1
Option 2
How it works...
2. Setting Up and Managing Code Repositories
Introduction
Setting up the Fabrikam solution in FabrikamTFVC Team Project
Setting up the Fabrikam solution in FabrikamGit Team Project
Creating a Git repository in an existing TFVC Team Project
Getting ready
How to do it...
How it works...
There's more...
Enabling code analysis check-in policy
Getting ready
How to do it...
How it works...
There's more...
Performing a baseless merge between sibling branches in TFVC
Getting ready
How to do it…
How it works…
Reparenting a branch in TFVC
Getting ready
How to do it…
How it works…
Unlocking files checked out by someone else
Getting ready
How to do it...
There's more...
Unshelving a shelveset created in one branch to another branch
Getting ready
How to do it...
Ignoring file types from check-in using .tfignore and .gitignore
Getting ready
How to do it...
There's more…
Conducting code reviews in TFS
Getting ready
How to do it…
How it works…
There's more...
Setting up policies for branches in Git
Getting ready
How to do it...
How it works...
There's more...
Conducting Pull requests in TFS
Getting ready
How to do it...
How it works...
Analyzing code churn with TFS analysis services cube
Getting ready
How to do it...
How it works...
There's more...
3. Planning and Tracking Work
Introduction
Selecting the backlog levels displayed on the Team Portal
Getting ready
How to do it...
How it works...
There's more...
Mapping, assigning, and tracking Work Items shared by multiple Teams
Getting ready
How to do it...
How it works...
There's more...
Adding additional columns to the Kanban board
Getting ready
How to do it...
How it works...
There's more...
Customizing cards displayed on the boards
Getting ready
How to do it...
Setting up the Team's capacity and activity for a sprint
Getting ready
How to do it...
How it works...
There's more...
Querying Work Items by Tags
Getting ready
How to do it...
There's more...
Creating charts using Work Item Queries
Getting ready
How to do it...
How it works...
Using Service Hooks to integrate with Trello boards
Getting ready
How to do it…
How it works…
There is more…
Deleting Work Items in TFS permanently
Getting ready
How to do it…
How it works…
Using Microsoft Feedback Client to provide feedback
Getting ready
How to do it...
How it works...
4. Building Your Application
Introduction
Configuring TFBuild Agent, Pool, and Queues
Getting ready
How to do it
How it works...
Setting up a TFBuild Agent using an unattended installation
Getting ready
How to do it...
How it works...
Creating a continuous integration build definition in TFBuild
Getting ready
How to do it...
How it works...
There's more…
Pinning a build badge to the welcome page in Team Portal
Getting ready
How to do it...
How it works...
There is more
Managing build resources using role-based access
Getting ready
How to do it...
How it works...
Using the build retention policy to automate build deletion
Getting ready
How to do it...
How it works...
There's more…
Using user capabilities to identify a build agent in a pool
Getting ready
How to do it…
How it works…
Version DLLs in build output with build number
Getting ready
How to do it…
How it works…
Creating a new build task using the TFBuild Extensibility framework
Getting ready
How to do it...
How it works...
Integrating SonarQube with TFBuild to manage technical debt
Getting ready
How to do it…
How it works…
There's more…
Building GitHub code repositories with TFBuild
Getting ready
How to do it...
How it works...
5. Testing Your Application
Introduction
Running NUnit tests in the CI Pipeline using TFBuild
Getting ready
How to do it...
How it works
Creating and setting up a Machine Group
Getting ready
How to do it...
How it works...
Deploying a test agent through the TFBuild task
Getting ready
How to do it...
How it works...
Distributing test execution on a Lab Machine Group
Getting ready
How to do it…
How it works…
Triggering Selenium Web Tests on a Selenium Test Grid using TFBuild
Getting ready
How to do it…
How it works…
Integrating the Cloud Load Testing Service in TFBuild
Getting ready
How to do it…
How it works…
Analyzing test execution results from the Runs view
How to do it...
How it works...
Exporting and importing test cases in Excel from TFS
Getting ready
How to do it…
Exporting test cases from TFS
Importing test cases from TFS
How it works…
There is more
Copying and cloning test suites and test cases
Getting ready
How to do it...
Copying (shallow copy)
Clone (deep copy)
How it works...
Exporting test artifacts and test results from the test hub
How to do it...
How it works...
There is more…
Charting testing status on Dashboards in Team Portal
Getting Started
How to do it...
How it works...
6. Releasing Your Application
Introduction
Creating a release definition in Team Web Portal
Getting ready
How to do it...
How it works…
Mapping artifacts to a release definition
Getting ready
How to do it...
How it works...
There is more...
Configuring a release definition for a continuous deployment
Getting ready
How to do it...
How it works…
There's more...
Adding and configuring environments in a release definition
Getting ready
How to do it...
How it works...
Configuring security for release definitions
Getting ready
How to do it…
How it works…
Configuring global and local variables for a release
Getting ready
How to do it…
How it works…
Deploying an Azure website using release management
Getting ready
How to do it…
How it works…
Deploying the IIS Web Application using release management
Getting ready
Where does it need to be installed?
What needs to be installed?
How to do it…
How it works…
There is more
Tracking a release in release management
How to do it…
How it works…
7. Managing Team Foundation Server
Introduction
Diagnosing builds in TFS
Getting ready
How to do it…
How it works…
Analyzing the TFS database and configuring test retention policies
Getting ready
How to do it...
How it works…
Using Activity and Job Monitoring logs to diagnose TFS issues
Getting ready
How to do it...
How it works...
Changing update frequency and forcing a rebuild of TFS Warehouse
Getting ready
How to do it…
How it works…
There is more
Configuring TFS Cache settings
Getting ready
How to do it...
How it works…
Managing CodeLens in TFS
Getting ready
How to do it...
How it works...
Continuous synchronization with the TFS Proxy server
Getting ready
How to do it...
How it works...
Creating a TFS database back up schedule
Getting ready
How to do it...
How it works...
Cleaning up unused workspaces and shelvesets in TFS – in progress
Getting ready
How to do it…
How it works…
8. Extending and Customizing Team Foundation Server
Introduction
Acquiring TFS object model from the NuGet Gallery
Getting ready
How to do it...
How it works…
Using Team Project Picker to connect to TFS programmatically
Getting ready
How to do it...
How it works…
Determining the version of TFS using the TFS object model
Getting ready
How to do it...
How it works...
Retrieving TFS permissions programmatically using the TFS object model
Getting ready
How to do it...
Getting the Process Template name for a Team Project programmatically
Getting ready
How to do it...
How it works...
Getting build details programmatically using the REST API
Getting ready
How to do it…
How it works…
Getting a list of Git repositories programmatically using the REST API
Getting ready
How to do it…
How it works…
Getting a Work Item by ID programmatically using the REST API
Getting ready
How to do it…
How it works…
Adding a Team field to the Product Backlog Item to an existing Team Project
Getting ready
How to do it…
How it works…
Adding multi-item select control in the Work Item form
Getting ready
How to do it…
How it works…
Index

Microsoft Team Foundation Server 2015 Cookbook

Microsoft Team Foundation Server 2015 Cookbook

Copyright © 2016 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.

First published: January 2016

Production reference: 1250116

Published by Packt Publishing Ltd.

Livery Place

35 Livery Street

Birmingham B3 2PB, UK.

ISBN 978-1-78439-105-8

www.packtpub.com

Credits

Author

Tarun Arora

Reviewers

Mohamed Aboelqasem

Mike Branstein

Michael Jurek

Sudheer Mohan Mirampally

Commissioning Editor

Douglas Patterson

Acquisition Editor

Vinay Argekar

Content Development Editor

Shali Deeraj

Technical Editor

Prajakta Mhatre

Copy Editor

Charlotte Carneiro

Project Coordinator

Sanchita Mandal

Proofreader

Safis Editing

Indexer

Tejal Daruwale Soni

Graphics

Kirk D'Penha

Jason Monteiro

Abhinash Sahu

Production Coordinator

Aparna Bhagat

Cover Work

Aparna Bhagat

About the Author

Tarun Arora is obsessed with high-quality working software, continuous delivery, and Agile practices. He has experience managing technical programs, implementing digital strategy, and delivering quality @ scale. Tarun has worked on various industry-leading programs for fortune 500 companies in the financial and energy sector.

He is one of the many geeks working for Avanade in the United Kingdom. Avanade helps clients and their customers realize results in a digital world through business technology solutions, cloud, and managed services that combine insight, innovation, and expertise in Microsoft technologies.

For the past 5 years, Tarun has been a Microsoft Most Valuable Professional in Visual Studio and Development Technologies. His core strengths are enterprise architecture, .NET, WPF, SQL, and PowerShell. He was awarded the MVP of the year award by Microsoft in 2014 for going over and above in supporting the product teams and the community with his contributions. He is also an ALM Ranger and has contributed to key guidance and tooling projects focused on Azure, Team Foundation Server, Visual Studio Team Services, and Visual Studio Extensibility. Tarun is an active open source community contributor, speaker, and blogger. Follow him on twitter at @arora_tarun and his blog at http://www.visualstudiogeeks.com for the latest and greatest in technology trends and solutions on DevOps and ALM.

Tarun loves photography and travel. He is a very active traveler and has travelled to more than 21 countries in the last few months. Parts of this book have been written on his journeys across three continents. While some chapters were written on the beaches of Mauritius, others were written in transit, airport lounges, and taxis. Follow his adventures on his travel blog (https://outofofficetraveller.wordpress.com).

Acknowledgments

This book is dedicated to my mother, Mrs. Raj Rani Arora, and my father, Mr. Inder Jit Arora, without whom I wouldn't be what I am today. This book would never have been complete without the support of my lovely wife, Anuradha Arora. I would also like to thank my family and friends for their encouragement throughout the process.

The Microsoft Product Team, especially Brian Harry, Buck Hodges, Aaron Bjork, Chris Patterson, Gopi Chigakkagari, Ravi Shanker, Karen Ng, Charles Sterling, and Will Smyth, have been extremely helpful in guiding the direction of this book.

I would also like to thank ALM Champs and ALM Rangers for their technical inputs and review on the book, especially Josh Garverick, Utkarsh Shigihalli, and Willy Peter Schaub.

About the Reviewers

Mohamed Aboelqasem is a solution architect in Kuwait Finance House Bank—development department, where he engages with leading and designing different enterprise on-premises and cloud solutions. He brings over 12 years of deep technical experience to Microsoft technologies. He has deep practical experience in the government, financial, and oil and gas industries. M.Aboelqasem works mainly in the Middle East, Egypt, KSA, and Kuwait. He currently resides with his family in Kuwait.

He is working in the KFH bank, which is one of the biggest Islamic banks in the Middle East and is the Islamic bank leader in Kuwait. KFH owns groups of banks in different countries such as Bahrain, Turkey, Malaysia, Saudi, and Germany.

I would like to thank my wife for helping and supporting me in my social and professional life, which always increases my moral to share in professional communities.

Mike Branstein is a developer and leader, who is passionate about systems architecture, team building, application life cycle management, and technology. Mike lives in Louisville, KY, and is the director of application development at KiZAN Technologies. As a consultant, he enjoys working with clients to improve development and project management processes using Team Foundation Server.

Mike blogs with his brother, Nick Branstein, at http://brosteins.com, where they are known as "The Brosteins". You can find Mike on Twitter at @mikebranstein.

Michael Jurek is a senior professional with over 15 years of experience in the IT industry. He likes learning new technologies and enjoys addressing technological challenges. He sees himself as a strong and creative personality with very good communication and presentation skills and a great sense of humor.

Michael worked for 13 years for Microsoft as a software architect focused on solution architecture, databases, ALM (Application Lifecycle Management), and cloud adoption. Since 2013, he has been a freelance consultant with the same focus.

Michael is married and has two children. His hobbies are using a giant astronomical telescope, playing volleyball, reading about the history of the Second World War, and manually working at his weekend house located deep in the forest.

Sudheer Mohan Mirampally is a senior solution architect for Yash Technologies, where he is responsible for the technology and architecture across US and Middle East (Dubai, Saudi Arabia, Bahrain). He is currently in the Yash Technologies Global presales team and supports sales and customer/prospect engagements.

As a solution architect at Yash, he is responsible for building and presenting customized business solutions with Microsoft Dynamics CRM and Office 365, in addition to integrating CRM and Dynamics Marketing, Dynamics NAV, and Dynamics AX, he is also well poised in SQL Server DQS and MDM.

Sudheer completed his MCA degree from Osmania University, and has a total of 11 years of experience in CRM and Microsoft Stack consulting, implementing, and supporting solutions that have diverse technologies and capabilities. He worked as a consultant and implemented the business solutions with Intac, Cyquent FZ LLC, Source Edge, and HCL (ADHAAR).

I would like to thank my parents, my siblings, my wife, and all my colleagues for their continuous support every day. I would also like to thank the Team Foundation Server community.

I would like to thank Packt Publishing for giving me the opportunity to review this book. My special thank goes to my guru, Mr. Sunil Kumar Benny, and my best friends, Vivek Patil (Compusoft India) and Ahmad Saad, for their continuous help and support in my life.

www.PacktPub.com

Support files, eBooks, discount offers, and more

For support files and downloads related to your book, please visit www.PacktPub.com.

Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at <[email protected]> for more details.

At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.

https://www2.packtpub.com/books/subscription/packtlib

Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can search, access, and read Packt's entire library of books.

Why subscribe?

Fully searchable across every book published by PacktCopy and paste, print, and bookmark contentOn demand and accessible via a web browser

Free access for Packt account holders

If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view 9 entirely free books. Simply use your login credentials for immediate access.

Instant updates on new Packt books

Get notified! Find out when new books are published by following @PacktEnterprise on Twitter or the Packt Enterprise Facebook page.

Preface

Visual Studio is a suite of Microsoft Developer Tools and Services, a few key ones being Visual Studio IDE, Visual Studio Code, Visual Studio Team Services, and Visual Studio Team Foundation Server (TFS). Back in November 2004, Microsoft released its first version of integrated Application Lifecycle Management (ALM) tool, called "Microsoft Visual Studio Team Systems". Over the last 15 years, the product has gone through several evolutions, each enriching the developer experience and the scope of tooling:

Visual Studio – Any App Any Developer

The Visual Studio family of tools and services now enables heterogeneous software development across various platforms. The experience of using open source tooling within the product has improved tremendously. Open source solutions are being given first class citizen status, and more of these solutions are being pre-packaged into the product. This gives us a clear indication that Microsoft wants to become the platform of choice for every developer, independent of the technology or platform. There is a huge overlap between the tools and services within the Visual Studio family of tools. This book focuses entirely on Visual Studio Team Foundation Server 2015.

Microsoft Visual Studio Team Foundation Server 2015 is at the center of Microsoft's ALM solution, providing core services such as version control, Work Item tracking, reporting, and automated builds. TFS helps organizations communicate and collaborate more effectively throughout the process of designing, building, testing, and deploying software, ultimately leading to increased productivity and team output, improved quality, and greater visibility of an application's life cycle.

Software delivery itself has gone through a revolution in the last decade. The introduction of Agile practices and lean frameworks, such as Scrum, Kanban, XP, and RUP, among others, have demonstrated that iterative feedback-driven development helps to cope with changes in the marketplace, business, and user requirements. Lean processes also help minimize waste and maximize value delivery to end users. Better DevOps practices encouraging continuous integration, continuous deployment, continuous delivery, and continuous feedback along with better tooling are enabling organizations to break the silos between teams. Mission-critical applications may still choose to deliver using Waterfall, while a line of business applications may find more success choosing lean methodologies. There is no right or wrong in this; choose the process and tools that are most appropriate to your delivery scenario. Visual Studio TFS supports most processes out of the box, and gives you the flexibility to customize and define processes that work best for your organization.

Visual Studio Team Foundation Server 2015, henceforth referred to as TFS in this book, is Microsoft's on-premise offering of ALM Tooling. Microsoft also offers a cloud-hosted service called Visual Studio Team Services (VSTS). Do not confuse VSTS for being Visual Studio IDE in the cloud; it is instead a collection of developer services comparable to TFS that run on Microsoft Azure and extend the development experience in the cloud. Microsoft is really committed to its hosted service, and has moved it into a 3-week cadence. All features are released in VSTS first, and then, most features are rolled into TFS via quarterly updates. A timeline of features released and those planned in the future releases can be found at https://www.visualstudio.com/en-us/news/release-archive-vso.aspx. The product teams solicit new feature requests via user voice. If you have a burning idea for a feature, be sure to log your request at https://visualstudio.uservoice.com/forums/121579-visual-studio-2015. VSTS now offers a lot of enterprise features such as guaranteed uptime, single sign on using ADFS and AAD, and compliance to US, European, and Australian data sovereignty laws by offering tenants hosted in those regions. Though VSTS boasts of having over 3 million active users, organizations that need more control of the environment and their data will still prefer TFS over VSTS.

Note

All recipes in this book are designed for TFS; however, because of the overlap between VSTS and TFS, most of what you learn in this book is applicable to VSTS.

The various clients that can be used to connect to TFS can be broadly divided into two groups—primary clients, and task-specific clients, as shown in the following screenshot. A full list of the functions that can be performed using these clients can be found at https://msdn.microsoft.com/en-us/library/ms181304.aspx.

If you're setting up TFS for personal use, or to evaluate the core features, such as version control, build, and Work Item tracking, use TFS Express. It's free, it's simple to set up, and it can be installed on both client and server operating systems. Express does not support integration with SharePoint or Reporting Services. If you are setting up TFS for your organization, use the standard version of TFS. You can set up TFS on a single computer, in a dual server configuration, or in a multi-server configuration. Use the following handy reference to check the compatibility matrix for TFS 2015:

https://msdn.microsoft.com/Library/vs/alm/TFS/administer/requirements

The TFS architecture setup and network and port requirements can be found at https://msdn.microsoft.com/en-us/library/ms252473(v=vs.120).aspx. The product setup documentation can be found at https://msdn.microsoft.com/en-us/Library/vs/alm/TFS/setup/overview. The planning and disaster recovery guidance (http://vsarplanningguide.codeplex.com/) from ALM Rangers is very useful when planning an enterprise grade TFS setup. TFS 2015-specific license updates will be covered in the Assigning a license, adding users, and auditing user access recipe in Chapter 1, Team Project Setup. To learn more about the license requirements for TFS, please read through the Visual Studio and MSDN Licensing white paper at http://www.microsoft.com/en-gb/download/details.aspx?id=13350.

The recipes in this book require a standard one machine setup of TFS. You can set up a standalone single server using the preceding installation instructions, or, alternatively, use a preconfigured TFS 2015 Virtual Machine. Instructions to download and set this up can be found at http://vsalmvm.azurewebsites.net/.

What this book covers

Chapter 1, Team Project Setup, covers Team Project, which is a logical container isolating all tools and artifacts associated with a software application together in a single namespace. Features such as Welcome pages, Dashboards, Team Rooms, and many more enable better collaboration within Teams, whereas the ability to rename Team Projects and scripting Team Project creation empowers you to better administer a Team Project. In this chapter, we'll learn the different features of a Team Project and how to set up these features to leverage them to their full potential.

Chapter 2, Setting Up and Managing Code Repositories, introduces TFS, which is the only product to offer a centralized as well as distributed version control system. In this chapter, we'll learn how to set up both TFVC and Git repositories in a single project and how to tackle technical debt by enforcing code reviews and code analysis into the development workflows.

Chapter 3, Planning and Tracking Work, explains the requirements that are implemented but never used, or those that are used just long enough to identify that they don't satisfy the needs of the users cause and waste, re-work, and dissatisfaction. In this chapter, we'll learn how to set up and customize multiple backlogs, Kanban, and Sprint Task Board. We'll also learn how to integrate with external planning tools using Service Hooks, and how to improve the feedback loop by leveraging the feedback features in TFS.

Chapter 4, Building Your Application, introduces the new build system (TFBuild), which is a cross platform, open, and extensible task-based execution system with a rich web interface that allows the authoring, queuing, and monitoring of builds. In this chapter, we'll learn how to set up and use TFBuild for continuous integration. We'll also learn how to integrate TFBuild with SonarQube and GitHub. We'll also review features that help lay the foundations for continuous delivery of software.

Chapter 5, Testing Your Application, states that low quality software just isn't acceptable. But you may ask "what is the right level of quality?" In this chapter, we'll learn how to plan, track, and automate using the testing tools available in TFS. We'll also learn how to leverage the new build system to integrate non-Microsoft testing frameworks, such as Selenium and NUnit, into the automation testing workflows.

Chapter 6, Releasing Your Application, explains the new web-based Release Manager in TFS that uses the same agent and task infrastructure offered by TFBuild. In this chapter, we'll learn how to set up, secure, and deploy to multiple environments using release pipelines. We'll also learn how to track and report on releases delivered through the release pipeline. The techniques in this chapter enable you to set up your software for continuous delivery.

Chapter 7, Managing Team Foundation Server, teaches you how to update, maintain, and optimize your TFS, enabling high availability for geo-distributed Teams and reducing the administration overheads.

Chapter 8, Extending and Customizing Team Foundation Server, explains that it is not uncommon for organizations to have different tools to manage different parts of the life cycle, for example, Jira for Agile project management, TeamCity for builds, Jenkins for release management, and ServiceNow for service management. In this chapter, we'll learn about the TFS object model and TFS REST APIs to programmatically access and integrate with systems. In this chapter, we'll also cover how to customize Team Projects by leveraging Process Template customization.

What you need for this book

The recipes in this book are based on Team Foundation Server 2015. All recipes have been tested with the TFS 2015 Update 1 setup. To work through the recipes, you'll need a working setup of Team Foundation Server 2015 with Visual Studio 2015.

Who this book is for

This book is for all software professionals, including developers, testers, architects, managers, and configuring analysts, using or planning to use TFS.

The book covers the functions of Team Foundation Server 2015, including Team Projects, Source Control, Work Items, Build, Test, Release, Administration, Extensibility, and Customization with focus on DevOps and ALM-centric topics.

This book provides hands-on recipes to leverage new and existing features of TFS for Scrum Teams to enable continuous delivery of high quality software, faster. Rather than just covering the theoretical concepts, each recipe uses a cookbook format that presents a problem, solution, and explanation, taking you directly into real-world practical usage scenarios.

The book assumes you have a working setup of Team Foundation Server 2015 and basic knowledge of TFS, Software Development Lifecycle, and Scrum framework.

Sections

In this book, you will find several headings that appear frequently (Getting ready, How to do it, How it works, There's more, and See also.)

To give clear instructions on how to complete a recipe, we use these sections as follows:

Getting ready

This section tells you what to expect in the recipe, and describes how to set up any software or any preliminary settings required for the recipe.

How to do it…

This section contains the steps required to follow the recipe.

How it works…

This section usually consists of a detailed explanation of what happened in the previous section.

There's more…

This section consists of additional information about the recipe in order to make the reader more knowledgeable about the recipe.

See also

This section provides helpful links to other useful information for the recipe.

Conventions

In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "The tfsdeleteproject command carries out the deletion in two phases."

A block of code is set as follows:

# User-specific files *.suo *.user *.sln.docstates # Specific files *.txt # Build results [Dd]ebug/ [Rr]elease/

Any command-line input or output is written as follows:

refs/heads/master, TF402455: Pushes to this branch are not permitted; you must use pull requests to commit changes.

New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "From the Projects and My Teams submenu, click on New Team Project...."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.

To send us general feedback, simply e-mail <[email protected]>, and mention the book's title in the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files from your account at http://www.packtpub.com for all the Packt Publishing books you have purchased. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.

Piracy

Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at <[email protected]> with a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable content.

Questions

If you have a problem with any aspect of this book, you can contact us at <[email protected]>, and we will do our best to address the problem.

Chapter 1. Team Project Setup

 

"It is not the beauty of a building you should look at; it's the construction of the foundation that will stand the test of time."

  --David Allan Coe

In this chapter, we will cover:

Connecting to TFS using Team ExplorerSetting up your user profile in TFSCreating a Team Project using the Scrum TemplateAssigning a license, adding users, and auditing user accessConfiguring Dashboards in Team ProjectSetting up a welcome page for a Team ProjectCreating and setting up a Team RoomRenaming a Team ProjectCreating a new Team Project through the command lineDeleting a Team Project

Introduction

Microsoft Visual Studio Team Foundation Server provides a set of integrated tools enabling Teams to effectively manage the life cycle of their software project. The Team in Team Foundation Server is encapsulated within the container of a Team Project. Simply put, Team Project is a logical container isolating all tools and artifacts associated with a software application together in a single namespace.

The conceptual boundary introduced through Team Project eliminates the problem of having access to unrelated artifacts such as code, Work Items, or release information not relevant to your applications development. Related Team Projects can be grouped together into a Team Project Collection. It can be used to introduce a physical separation between the groups of related Team Projects by hosting them in separate databases.

Team Foundation Server supports multiple Team Project Collections, each of which can internally host multiple Team Projects. Resources such as build pools are scoped at the Team Project Collection level. A Team Project can host multiple Teams; certain resources are set at the Team Project level and others at the Team level. As illustrated in the following screenshot, the selection of a source control repository (TFVC or Git) is made at the Team Project level; however, Teams have autonomy on the level of backlogs they choose and the workflows on the Kanban board. The delivery framework of choice is applied through the Process Template; this in turn applies the delivery framework-specific terminology, artifacts, and workflows to the Team Project and all Teams within the Team Project:

TFS Reporting warehouse is a traditional data warehouse consisting of a relational database organized in an approximate star schema and an SQL Server Analysis Services cube built on top of the relational database. All Team Projects, irrespective of the Team Project Collection they belong to, are aggregated into a single data warehouse.

Team Foundation Server provides a hierarchical security model. Permissions can be set through TFS Groups or AD Group membership through every level, right from the server through to the object level. Groups can be nested and set to inherit permissions through the hierarchy. Inheritance of permissions can be set to Denied where you want to control access to selected resources. A more in-depth breakdown of precreated groups with details of access and permissions can be found at http://bit.ly/1PPaU6l.

Permissions can be used to limit access to resources within or between Team Projects, Team Project Collections provide an isolation altogether. Team Project Collections also provide other functional and technical benefits such as:

The usage of a single TFS instance across multiple departments while still providing a level of isolation. Collections can be used to reflect an organizational structure too.Flexibility in backup and restore. This can reduce downtime as restoring one collection will not impact users of other collections.Scalability and load balancing by moving collections on separate SQL Server instances.

In this chapter, we'll touch on Administration and Process Templates; these topics are discussed at length in future chapters. The focus of this chapter is on creating and setting up various elements of a Team Project.

Connecting to TFS using Team Explorer

To build, test, track, or release your software, you'll need to connect the client of your choice to Team Foundation Server. As a software developer, you'll spend a lot of time in the Visual Studio IDE. Whether you store the code in the TFS Git repository or TFVC source control, you'll need to connect the IDE to TFS to interact with the code. In this recipe, you'll learn how to connect to TFS using Team Explorer.

Getting ready

If you have any Visual Studio 2015 SKU installed, you already have Team Explorer. With TFS 2015, a separate install of Team Explorer is no longer available; you will need to install Visual Studio Community at the very least to get Team Explorer.

Note

To connect to TFS via any of the office products, you can install the TFS Office Integration Installer:http://bit.ly/1k3wh7p. You can read more about the benefits of the TFS Office Integration Installer at http://bit.ly/1Grh3DS.

When you start Visual Studio for the first time, you'll be asked to sign in with a Microsoft account, such as Live, Hotmail, or Outlook, and provide some basic registration information. Choose a Microsoft account that best represents you. If you already have a MSDN account, it's recommended that you sign in with its associated Microsoft account. If you don't have a Microsoft account, you can create one for free. Logging in has various benefits such as the synchronization of Visual Studio settings across multiple machines. While logging in is advisable, it is not mandatory.

How to do it...

Open Visual Studio 2015.Click on the Team toolbar and select Manage Connections...:From within Team Explorer, click on the Manage Connections hyperlink and choose Connect to Team Project:In the Connect to Team Foundation Server window, the drop-down shows a list of all the TFS Servers you have connected to before. If you don't see the server you want to connect to in the drop-down, click on Servers... to enter the details of the Team Foundation Server. Click on Add... and enter the details of your TFS Server. You may be required to enter the login details to authenticate with the server.The authenticated user details along with server details will update on the Connect to Team Foundation Server window. Click on the Connect button to complete the operation.You should be successfully connected to TFS via Team Explorer now:

How it works...

Visual Studio now ships with a GitHub connector. Now, the Manage Connections dialog within the Team Explorer allows you to connect not only to TFS and VSO, but also GitHub. This is a great example of how Microsoft is embracing open source by enabling seamless integration for non-Microsoft products.

Note

If you are a GitHub free account user, you will be limited to just one account in Visual Studio; this is a limitation posed by GitHub. GitHub Enterprise users have the ability to map multiple accounts from Team Explorer 2015.

If you are in two minds whether to log in to Visual Studio with Microsoft account, weigh these benefits:

Synchronizes your Visual Studio settings: Visual Studio settings such as key bindings and color theme, apply immediately when you sign in to Visual Studio on any another device.Extends the trial period: If you do not have a Visual Studio license, by logging in you can extend the trial period on Visual Studio Professional or Enterprise from 30 to 120 days.Unlocks Visual Studio: If your Microsoft account is associated with your MSDN account, your copy of Visual Studio is automatically unlocked.

If you do not want to synchronize the settings, this feature can be disabled. In the Tools menu, chose Options. Look for Synchronized Settings under Environment and uncheck the option as shown in the following screenshot:

Setting up your user profile in TFS

Team Foundation Server gives you the ability to personalize your experience by choosing your own settings. Every TFS user has a profile by virtue of a login. In this recipe, you'll learn how to customize your profile in TFS.

How to do it…

Open Team Portal by navigating to http://tfs2015:8080/tfs/.The top right-hand corner contains the name of the logged-in user. Click on the name to open the user profile control as shown in the following screenshot:Click on My profile to view and customize your profile. Let's go through the general settings first.To change your profile image, click on the Change picture hyperlink, choose an image less than 4 MB and click on Save Changes.To change the display name, click on the Edit hyperlink, change the name from Tarun to Tarun Arora, and click on Enter.To change the preferred e-mail, click on the Edit hyperlink, change the e-mail address to [email protected], and click on Enter.The UI SETTINGS field can be changed from default to high contrast by selecting the High contrast theme from the drop-down:Switch over to the locale settings by clicking on the LOCALE tab. The language and time zone settings can be changed from here.

How it works…

User profile settings only apply to the individual; these settings will not impact other users. Your profile should now have an image, display name, preferred e-mail address, and a theme of your choice. Any alerts you may configure for Work Item, build, and code review will be delivered to your preferred e-mail address.

The time zone settings in TFS will override the time zone settings of the machine. For example, if your machine is in the UTC + 1 time zone, but your profile is configured to UTC + 5:30. On creating a new Work Item, the created time in the Work Item will be UTC + 5:30 and not UTC + 1.

Note

There are certain functions in the Team Foundation Server that are influenced by the time zone settings of where the Team Foundation Server is hosted. For example, if your Team Foundation Server is hosted in Washington, USA, and part of your distributed Team is in Delhi, India, the current sprint would end based on when the day ends in Washington.

When the profile is opened within the scope of a Team Project, you'll see the My alerts option in the Profile menu. Alerts allow you to configure e-mail notifications when certain events occur within a Team Project. For example, build completion, Work Item assignment, and so on.

Clicking on My alerts will launch the window to manage your TFS Alerts. Basic and Custom Alerts can be managed from within this window. Alerts can be customized with clauses. The window also contains a link to the advanced alerts management page that can be used to manage the Team Alerts.

Creating a Team Project using the Scrum Template

In TFS, a Team Project is a logical container that stores artifacts such as Work Items, code, builds, and releases. Different Teams follow different processes to organize, manage, and track work. TFS allows process specification via Process Templates. The Scrum, Agile, and CMMI template are offered out of the box. The Process Template defines the set of Work Item types, queries, and reports that can be used to plan and track the project. In this recipe, you'll learn how to create a new Team Project using the Scrum Template.

Getting ready