DevOps with Windows Server 2016
上QQ阅读APP看书,第一时间看更新

Preface

With the adoption and popularity of cloud technology, DevOps has become the most happening buzzword in the industry. The concepts of DevOps are not new and have been implemented historically. In recent times, DevOps is getting implemented widespread in enterprise world. Companies that have not yet implemented DevOps have started discussing its potential implementation. In short, DevOps is becoming ubiquitous across both big and small organizations.  Organizations are trying to reach out to their customers more often with quality deliverables. They want to achieve this while reducing the risks involved in releasing to production. DevOps helps in releasing features more frequently, faster, and better, in a risk-free manner. It is a common misconception that DevOps is either about automation or technology. Technology and automation are enablers for DevOps and help better and faster DevOps implementation. DevOps is a mindset and culture, it is about how multiple teams come together for a common cause and collaborate with each other, it is about ensuring customers can derive value from software releases, and it is about bringing consistency, predictability, and confidence to overall application life cycle processes. DevOps also has levels of maturity. The highest level of DevOps is achieved when multiple releases can be made in an automated fashion with high quality through continuous integration, continuous delivery, and deployment. It is not necessary that every company should achieve this level of DevOps maturity. It depends on the nature of the company and its projects. While fully automated deployment is a need for some companies, it could be overkill for others. DevOps is a journey and companies typically start from a basic level of maturity by implementing a few of its practices. Eventually, these companies achieve high maturity as and when they keep improving and implementing more and more DevOps practices. DevOps is not complete without appropriate infrastructure for monitoring and measuring health of both environment and application. DevOps forms a closed loop, with operations providing feedback to development teams about things that work well in production and things that do not work well.

In this book, we will explore the main motivation for using DevOps and discuss in detail the implementation of its important practices. Configuration management, source code control, continuous integration, continuous delivery and deployment, monitoring and measuring concepts and implementation will be discussed in depth with the help of a sample application. We will walk through the entire process from scratch. On this journey, we will also explore all the relevant technologies used to achieve the end goal of DevOps.

This book has relevant theory around DevOps, but is heavy on actual implementation using tools and technologies available today. There are many ways to implement DevOps and this book talks about approaches using hands-on technology implementation. There is little or no material that talks about end-to-end DevOps implementations, and this book tries to fill this gap.

I have approached this book by keeping architects, developers and operations teams in mind. I have played these roles, understand the problems they go through, and tried to solve their challenges through practical DevOps implementation.

DevOps is an evolving paradigm and there will be advancements and changes in future. Readers will find this book relevant even in those times.

What this book covers

Chapter 1, Introducing DevOps, introduces the motivation for implementing the DevOps paradigm in any software development endeavor. The chapter focuses on practices and principals at a high level, creating the context for other chapters in the book.

Chapter 2, DevOps Tools and Technologies, walks through the major technology components important from a DevOps implementation perspective. It discusses cloud technologies, build and release management services, Git, Windows Server 2016, Docker containers, and Nano servers. This chapter provides a brief introduction to each of these technologies.

Chapter 3, DevOps Automation Primer, walks through major automation technologies, enabling faster and better DevOps implementation. This chapter provides a brief introduction to PowerShell, Azure Resource Manager templates, Pester, and Desired State Configuration.

Chapter 4, Nano, Containers, and Docker Primer, focuses on new Windows Server 2016 features such as Nano servers, containers, and Docker. It provides an introduction to these technologies with examples. The chapter shows how to provision Nano servers using Azure PowerShell, containers using Azure Resource Manager template, and working with Docker and dockerfiles.

Chapter 5, Building a Sample Application,  introduces a sample application that helps in showing and implementing DevOps practices. It is an ASP.NET MVC web application consisting of a frontend and a database. The chapter also discusses important technical components that are integral to the sample application.

Chapter 6, Source Code Control, discusses the importance of using a version control system and provides multiple ways to interact and work with Visual Studio Team Services using Git. It shows ways to check-in the sample application into Git, and multiple ways to interact and work with VSTS Git repositories using Visual Studio. It also provides a small primer into working with Git using commands.

Chapter 7, Configuration Management, introduces one of the most important DevOps practices and its implementation. It discusses the concept of Infrastructure as Code and its importance. This chapter focuses on infrastructure and application configuration management. It provides descriptions of the code, scripts, and configuration used for the sample application. The sample application will be deployed using these configuration management artifacts.

Chapter 8, Configuration Management and Operational Validation, continues where the last chapter ended. It shows implementation of Infrastructure as Code, along with unit testing and the operational validation of environments.

Chapter 9, Continuous Integration, discusses another important DevOps practice and provides details about its importance, principles, benefits, and implementation. Visual Studio Build pipelines are discussed extensively while providing details about a sample build pipeline built for the sample application.

Chapter 10, Continuous Delivery and Deployment, discusses two of the most important DevOps practices and provides details about their importance, principles, benefits, and implementation. Visual Studio Release pipelines are discussed extensively while providing details about a sample release pipeline consisting of multiple environments built for the sample application.

Chapter 11, Monitoring and Measuring, discusses at length the concepts and implementation related to monitoring and measuring the different aspects of applications and environments in the production environment for the sample application.

What you need for this book

This book assumes a basic level knowledge on Windows operating system, cloud computing and application development using a web programming language, and moderate experience with the application development life cycle. The book will go through deployment of a sample application on Azure within Windows Containers using a set of virtual machine. This requires a basic understanding of cloud storage, computing, networking, and virtualization concepts on Azure. The book implements DevOps practices using Visual Studio Team Services and basic knowledge of this is expected, although this book tries to cover its foundations. If you have experience with Azure and Visual Studio Team Services, this is a big plus.

A valid Azure subscription and Visual Studio Team Services subscription is needed to get started with this book. They are both available free of cost on a trial basis.

As all deployments are made to the cloud, you will require a development environment on a local computer, consisting of:

  • CPU: 4 cores
  • Memory: 8 GB RAM
  • Disk space: 250 GB

This should be enough for the development environment.

In this book, you will need the following software:

  • Azure subscription
  • Visual Studio Team Services subscription
  • Windows 10 OS build 14393 version 1607 or Windows Server 2016 build 14393
  • SQL Server Management Studio version 12 or 13
  • Git for Windows 64-bit 2.12.0
  • Visual Studio community 2015 SP 3 version 14.0
  • Docker 1.12.2-cs2-ws-beta

Internet connectivity is required to work with chapters in this book.

Who this book is for

The primary audience of this book are developers, IT professionals, enterprise architects, and software and solution architects who are shaping, implementing and designing strategies for their customers. DevOps engineers, IT operations professionals and students interested in learning and implementing DevOps  will find this book extremely useful.

To make full use of the content of this book, basic prior knowledge of a programming language, scripting language, containers, and cloud computing is expected. If you feel you do not have that knowledge, it is always possible to catch up on the basic requirements by quick reading the documentation available on the Internet at https://docs.microsoft.com/en-gb/.

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: "Dockerfile is a file containing instructions to create an image"

A block of code is set as follows:

{
      "type": "Microsoft.Storage/storageAccounts",
      "name": "[variables('vhdStorageName')]",
      "apiVersion": "2015-06-15",
      "location": "[resourceGroup().location]",
      "tags": {
        "displayName": "StorageAccount"
      },
      "properties": {
        "accountType": "[variables('vhdStorageType')]"
      }
},

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

PS C:> docker --version
Docker version 1.12.2-cs2-ws-beta, build 050b611

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: "Right-click on *.westeurope.cloudapp.azure.com | Certificate | All Tasks and then Export."

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 feedback@packtpub.com, 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 for this book from your account at http://www.packtpub.com. 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.

You can download the code files by following these steps:

  1. Log in or register to our website using your e-mail address and password.
  2. Hover the mouse pointer on the SUPPORT tab at the top.
  3. Click on Code Downloads & Errata.
  4. Enter the name of the book in the Search box.
  5. Select the book for which you're looking to download the code files.
  6. Choose from the drop-down menu where you purchased this book from.
  7. Click on Code Download.

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/DevOps-with-Windows-Server-2016. We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Downloading the color images of this book

We also provide you with a PDF file that has color images of the screenshots/diagrams used in this book. The color images will help you better understand the changes in the output. You can download this file from https://www.packtpub.com/sites/default/files/downloads/DevOpswithWindowsServer2016_ColorImages.pdf.

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 copyright@packtpub.com 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 questions@packtpub.com, and we will do our best to address the problem.