Book Image

Azure Resource Manager Templates Quick Start Guide

By : Ritesh Modi
Book Image

Azure Resource Manager Templates Quick Start Guide

By: Ritesh Modi

Overview of this book

Azure Resource Manager (ARM) templates are declarations of Azure resources in the JSON format to provision and maintain them using infrastructure as code. This book gives practical solutions and examples for provisioning and managing various Azure services using ARM templates. The book starts with an understanding of infrastructure as code, a refresher on JSON, and then moves on to explain the fundamental concepts of ARM templates. Important concepts like iteration, conditional evaluation, security, usage of expressions, and functions will be covered in detail. You will use linked and nested templates to create modular ARM templates. You will see how to create multiple instances of the same resources, how to nest and link templates, and how to establish dependencies between them. You will also learn about implementing design patterns, secure template design, the unit testing of ARM templates, and adopting best practices. By the end of this book, you will understand the entire life cycle of ARM templates and their testing, and be able to author them for complex deployments.
Table of Contents (12 chapters)
Free Chapter
1
Section 1: ARM Template Foundational Skills
6
Section 2: ARM Template Advanced Concepts

To get the most out of this book

Readers will make the best use of this book if they first read the chapter and execute the code file associated with that chapter. Further knowledge may be acquired if readers go through the entire template, trying to understand the importance of each and every line of JSON code in each template. Finally, I would recommend that readers write these templates on their own at least once, so as to really develop complete hands-on knowledge of the subject. While doing so, you can refer to these templates as well.

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-Resource-Manager-Templates-Quick-Start-Guide. 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!

Download the color images

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: "This function allows utilization of the value stored in parameter for any resource configuration. parameters can be referenced from the variables, resources, and outputs sections of the same template."

A block of code is set as follows:

"parameters": {
"storageAccountName": {
"type" : "string"
}
}

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

 "[variables('multiLocation').location[copyIndex()].resourceGroupName]",
"properties": {
"mode": "Incremental",
"templateLink": {
"uri": "[variables('templateRefAppPlanTemplateUri')]",
"contentVersion": "1.0.0.0"
},

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

 Install-Module cmdlet

Bold: Indicates a new term, an important word, or words that you see on screen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "Provide a Name and Location in the New Project dialog box and click on OK."

Warnings or important notes appear like this.
Tips and tricks appear like this.