Book Image

Azure DevOps Server 2019 Cookbook - Second Edition

By : Tarun Arora, Utkarsh Shigihalli
Book Image

Azure DevOps Server 2019 Cookbook - Second Edition

By: Tarun Arora, Utkarsh Shigihalli

Overview of this book

Previously known as Team Foundation Server (TFS), Azure DevOps Server is a comprehensive on-premise DevOps toolset with a rich ecosystem of open source plugins. This book will help you learn how to effectively use the different Azure DevOps services. You will start by building high-quality scalable software targeting .NET, .NET Core and Node.js applications. Next, you will learn techniques that will help you to set up end-to-end traceability of your code changes, from design through to release. Whether you are deploying software on-premise or in the cloud in App Service, Functions, or Azure VMs, this book will help you learn release management techniques to reduce failures. As you progress, you will be able to secure application configuration by using Azure Key Vault. You will also understand how to create and release extensions to the Azure DevOps marketplace and reach the million-strong developer ecosystem for feedback. Later, the working extension samples will even allow you to iterate changes in your extensions easily and release updates to the marketplace quickly. By the end of this book, you will be equipped with the skills you need to break down the invisible silos between your software development teams, and transform them into a modern cross-functional software development team.
Table of Contents (14 chapters)
Title Page
About Packt
Contributors
Preface
Index

Preface

Development teams are judged by the speed at which they can convert an idea into working software. Operations teams are judged on the uptime and stability of the production environment. One wants to deploy changes all the time, the other doesn't want any changes at all. These conflicting goals result in development teams and operation teams working against each other. The introduction of Agile practices has demonstrated that iterative feedback-driven development helps teams cope with changes in business and user requirements. Agile practices help development teams accelerate the creation of ready-to-ship software. Software that's ready to ship but hasn't shipped doesn't provide any value to users. 

DevOps has been an emerging trend in the software development world for the past few years. While the term may be relatively new, it is really a convergence of a number of practices that have been evolving for decades. DevOps is a revolutionary way to ship working software quickly and efficiently while maintaining a high level of security. DevOps advocates that everyone and everything that's needed to ship working software to of end users needs to be part of the software development life cycle. Building software is an iterative process; therefore, a high level of automation is needed to make the process of developing, testing, releasing, and monitoring software easily repeatable. The emphasis is on delivering value to end users by collaborating, automating, learning, and constantly improving the software. Simply put, DevOps is the union of people, processes, and products to enable the continuous delivery of value to end users.

While DevOps isn't just a tool you can buy and install, tooling is an integral part of DevOps. Microsoft Azure DevOps Server 2019, formerly known as Team Foundation Server, is a set of collaborative software development tools, hosted on-premises. Azure DevOps Server integrates with your existing IDE or editor, enabling your cross-functional team(s) to work effectively on projects of all sizes. Azure DevOps Server works for any language, and on any platform. Azure DevOps Server has everything you need to turn an idea into a working piece of software. You can plan your project with Agile tools, you can manage your test plans, version your code using Git, and deploy your solution using an incredible cross-platform CI-CD system, all while getting full traceability and visibility across your development activities.

Starting your DevOps journey may seem overwhelming with a product that's so diverse and an ecosystem that's so vibrant. With over 70 hands-on tooling recipes, you'll learn how to accelerate your journey of DevOps by planning, coding, building, testing, and releasing high-quality working software using effective automation techniques with Azure DevOps Server 2019. 

Who this book is for

This book is for all software professionals, including developers, operations, testers, architects, managers,and configuration analysts, who are using or planning to use Azure DevOps Server.

What this book covers

Chapter 1, Planning and Tracking Work, explains how to create and set up a scrum team project, import requirements as work items from Excel, use work items for collaboration, set up hierarchical backlogs, configure and customize kanban boards, prepare and plan a sprint, use delivery plans to track multiple teams, and use dashboards for planning and tracking work.   

Chapter 2, Source Control Management, covers the differences between Git and TFVC, why Git is more suited for greenfield projects with distributed teams working on small codebases, how to migrate from TFVC to Git with history, how to access Azure DevOps Git repositories using SSH, and how to import a Git repository from GitHub into Azure DevOps Server. It also explains how to perform Git operations using the command line and Visual Studio Code, how to configure branch policies and use pull requests to review code, how to configure and use Git Hooks, how to manage and store large files in Git, how to use Git branching strategies for CD, and how to search code in Azure DevOps using the code search service. 

Chapter 3, Build and Release Agents, explains how to set up build and release agents, automate the setup of build and release agents using unattended installation with PowerShell, download agents from GitHub using the GitHub release API, configure deployment groups, run an Azure DevOps agent behind a corporate enterprise proxy, analyze build usage data, automate agent pool maintenance, and configure retention policies for builds and releases. In this chapter, you'll also learn how to use agent capabilities and demands to map build definitions to specific agents in pools, and finally, how to manage and permission agent usage using role-based access control.   

Chapter 4, Continuous Integration and Build Automation, defines continuous integration. It also explains how to configure one build pipeline to build all branches of a code repository, how to reflect the branch quality in the build name by dynamically updating the build name during pipeline execution, how to use web deploy to create a package in an ASP.NET build pipeline, how to organize the output from a build into logical folders, how to use an assembly version to stamp assemblies in a pipeline, how to set up a build pipeline for a .NET Core application, how to set up a build pipeline for a Node.js application, and how to set up a build pipeline for database projects. You'll also learn how to use SonarQube in a build pipeline to manage technical debt.

Chapter 5, Continuous Testing, shows the direction Microsoft is taking with its testing tools, along with the rationale behind discontinuing some of the testing tools. It also shows how to run NUnit-based unit tests in a pipeline, how to use feature flags to test in production, how to distribute multi-configuration tests on agent pools, how to configure parallel execution of automated tests to speed up overall test execution, how to run functional Specflow tests using Azure pipelines, how to analyze test execution results from the runs view. You'll also learn how to export test artifacts and test results from Test Hub, and finally, how to chart test results on dashboards in Azure DevOps Server team projects.    

Chapter 6, Continuous Deployments, defines continuous deployment. It also explains how to deploy the database to SQL Azure using Azure release pipelines, how to consume secrets in Azure pipelines from the Azure Key Vault, how to deploy a .NET Core app into Azure App Service, how to deploy an Azure Function using Azure Pipelines, and how to publish secrets to Azure Key Vault. In this chapter, you'll also learn how to deploy a static website on Azure Storage, and finally, deploy a VM to Azure DevTest Labs.   

Chapter 7, Azure Artifacts and Dependency Management, explains how to leverage artifacts to break down monolithic applications into microservices, how to publish a NuGet package to artifacts, how to consume a NuGet package feed in Visual Studio, how to publish an NPM package to an artifact feed in Azure DevOps Server, how to test NuGet packages using artifact views, and how to secure your packages by scanning for known vulnerabilities in your dependencies using WhiteSource.

Chapter 8, Azure DevOps Extensions, explains how to leverage the Azure DevOps Server APIs to extend Azure DevOps Server, how to create a new publisher in Visual Studio Marketplace, how to create a simple task to clean folder, how to create a UI extension, how to create a service connection to connect to GitLab, how to create a pipeline task to consume the custom service connection and download GitLab sources and finally how to publish extensions to Visual Studio Marketplace using Azure Pipelines. 

To get the most out of this book

The book assumes you have a working setup of Azure DevOps Server 2019, basic knowledge of DevOps, and some familiarity with Azure DevOps Server. A free trial of the Azure subscription may be needed to try out some of the recipes. 

Download the example code files

You can download the example code files for this book from your account at www.packt.com. If you purchased this book elsewhere, you can visit www.packt.com/support and register to have the files emailed directly to you.

You can download the code files by following these steps:

  1. Log in or register at www.packt.com.
  2. Select the SUPPORT tab.
  3. Click on Code Downloads & Errata.
  4. Enter the name of the book in the Search box and follow the onscreen instructions.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

  • WinRAR/7-Zip for Windows
  • Zipeg/iZip/UnRarX for Mac
  • 7-Zip/PeaZip for Linux

The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Azure-DevOps-Server-2019-Cookbook-Second-Edition. In case there's an update to the code, it will be updated on the existing GitHub repository.

We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Conventions used

There are a number of text conventions used throughout this book.

CodeInText: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "Create a new file called azure-pipelines.yml."

 

A block of code is set as follows:

var printaz = require("print-azure-devops")
printaz.printAzureDevOps();

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

var colors = require("colors")
exports.printAzureDevOps = function () {
    console.log("Azure DevOps Server 2019".blue)
}

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

C:\Users\utkarsh>node -v
v10.15.3

Bold: Indicates a new term, an important word, or words that you see onscreen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "To do this, first, head to the Artifacts hub and click on the + New Feed button."

Note

Warnings or important notes appear like this.

Note

Tips and tricks appear like this.

Sections

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

To give clear instructions on how to complete a recipe, 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 you more knowledgeable about the recipe.

See also

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

Get in touch

Feedback from our readers is always welcome.

General feedback: If you have questions about any aspect of this book, mention the book title in the subject of your message and email us at [email protected].

Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit www.packt.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details.

Piracy: If you come across any illegal copies of our works in any form on the Internet, we would be grateful if you would provide us with the location address or website name. Please contact us at [email protected] with a link to the material.

If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.

Reviews

Please leave a review. Once you have read and used this book, why not leave a review on the site that you purchased it from? Potential readers can then see and use your unbiased opinion to make purchase decisions, we at Packt can understand what you think about our products, and our authors can see your feedback on their book. Thank you!

For more information about Packt, please visit packt.com.