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

Using protectedSettings

Another way to ensure that data is stored in an encrypted format and is only decrypted on a virtual machine is to use protectedSettings along with a Custom Script Extension. This object takes three properties. The configuration of the CommandToExecute property is similar to previous configurations; its purpose is to execute PowerShell scripts.

The storage account name is where we'll find the PowerShell script stored, and the storage account key will provide the account's access key. This information can be found within the Access keys menu item on Azure Portal, as shown in the following screenshot:

When using protected settings, the storage key is provided as its configuration. There is no need to append the SAS token to the URL. The new configuration of the resource is shown in the following snippet. Note that the complete code listing for this...