Azure Resource Manager Templates Quick Start Guide
eBook - ePub

Azure Resource Manager Templates Quick Start Guide

Create, deploy, and manage Azure resources with ARM templates using best practices

Ritesh Modi

Condividi libro
  1. 234 pagine
  2. English
  3. ePUB (disponibile sull'app)
  4. Disponibile su iOS e Android
eBook - ePub

Azure Resource Manager Templates Quick Start Guide

Create, deploy, and manage Azure resources with ARM templates using best practices

Ritesh Modi

Dettagli del libro
Anteprima del libro
Indice dei contenuti
Citazioni

Informazioni sul libro

Compose and decompose ARM templates and use advanced concepts like looping, conditions, dependencies, PowerShell and Desired State Configuration.

Key Features

  • Design, implement, and unit test ARM templates
  • Develop and deploy ARM templates following security best practices

Book Description

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.

What you will learn

  • Understand the foundations of ARM templates including nested and linked templates
  • Design, create, and unit test ARM templates using best practices
  • Learn about conditional deployments, looping, Custom Script Extensions using PowerShell, Bash, and DSC
  • Implement design patterns related to ARM templates
  • Run post-deployment PowerShell and Desired State Configuration scripts
  • Create solutions and deploy them on Azure using ARM templates

Who this book is for

This books is for developers, DevOps engineers, and architects who have experience in Azure.

Domande frequenti

Come faccio ad annullare l'abbonamento?
È semplicissimo: basta accedere alla sezione Account nelle Impostazioni e cliccare su "Annulla abbonamento". Dopo la cancellazione, l'abbonamento rimarrà attivo per il periodo rimanente già pagato. Per maggiori informazioni, clicca qui
È possibile scaricare libri? Se sì, come?
Al momento è possibile scaricare tramite l'app tutti i nostri libri ePub mobile-friendly. Anche la maggior parte dei nostri PDF è scaricabile e stiamo lavorando per rendere disponibile quanto prima il download di tutti gli altri file. Per maggiori informazioni, clicca qui
Che differenza c'è tra i piani?
Entrambi i piani ti danno accesso illimitato alla libreria e a tutte le funzionalità di Perlego. Le uniche differenze sono il prezzo e il periodo di abbonamento: con il piano annuale risparmierai circa il 30% rispetto a 12 rate con quello mensile.
Cos'è Perlego?
Perlego è un servizio di abbonamento a testi accademici, che ti permette di accedere a un'intera libreria online a un prezzo inferiore rispetto a quello che pagheresti per acquistare un singolo libro al mese. Con oltre 1 milione di testi suddivisi in più di 1.000 categorie, troverai sicuramente ciò che fa per te! Per maggiori informazioni, clicca qui.
Perlego supporta la sintesi vocale?
Cerca l'icona Sintesi vocale nel prossimo libro che leggerai per verificare se è possibile riprodurre l'audio. Questo strumento permette di leggere il testo a voce alta, evidenziandolo man mano che la lettura procede. Puoi aumentare o diminuire la velocità della sintesi vocale, oppure sospendere la riproduzione. Per maggiori informazioni, clicca qui.
Azure Resource Manager Templates Quick Start Guide è disponibile online in formato PDF/ePub?
Sì, puoi accedere a Azure Resource Manager Templates Quick Start Guide di Ritesh Modi in formato PDF e/o ePub, così come ad altri libri molto apprezzati nelle sezioni relative a Informatique e Cloud Computing. Scopri oltre 1 milione di libri disponibili nel nostro catalogo.

Informazioni

Anno
2019
ISBN
9781789612271
Edizione
1
Argomento
Informatique

Section 1: ARM Template Foundational Skills

In this section, the reader will learn the basics of ARM templates. This will include understanding important ARM template constructs and how to deploy them. Authoring complex templates using advanced features, including linked templates and nested templates, will also be part of this chapter. ARM templates have some unique features, such as functions and expressions, which will also be detailed in a comprehensive manner.
This section contains the following chapters:
  • Chapter 1, Infrastructure as Code and Configuration Management
  • Chapter 2, Azure Resource Manager Templates
  • Chapter 3, Understanding Core Elements of ARM Templates
  • Chapter 4, Advance Template Features

Infrastructure as Code and Configuration Management

Welcome, readers, to the world of Azure Cloud, Azure Resource Manager (ARM), and ARM templates. Azure Cloud is growing in leaps and bounds and has good acceptability within enterprises. Azure Cloud provides a very performance-centric, scalable, and reliable Azure Resource Manager platform for management and governance of our deployments. To create resources on Azure, ARM templates are preferred over other mechanisms because of their inherent advantages. These advantages are mentioned throughout this book.
ARM templates have become an essential skill for any serious development on Azure, and writing reusable effective ARM template is sought after by many organizations. The Azure DevOps paradigm, to a large extent, also depends on ARM templates for its automation requirements.
In this first chapter, we will cover the following topics:
  • Configuration management
  • Infrastructure as code
  • Understanding ARM templates
  • Designing ARM template
  • A primer on JSON
  • Introducing Azure Resource Manager

What is configuration management?

Every deployment comprises two stacks of resources:
  • Environment or infrastructure resources
  • Application deployment
Infrastructure resources refer to hardware, software, and platform resources that make an environment suitable for application deployment. For example: infrastructure resources might contain hardware resources, such as networks, load balancers, network interface cards, physical server, virtual machines, network connectivity, an operating system, as well as platform resources, such as container runtime, and framework deployments, such as .NET core. Each of these infrastructure resources should be configured in a way that ensures the application will work according to its design.
After infrastructure resource-provisioning, the application is deployed on top of them. These are related to resources such as application binaries, application dependencies, and package installations.
The configuration of these resources is needed across environments—from higher-level environments, such as the production environment, to lower-level environments, such as the dev and test environments. There can be multiple environments for a solution. The configuration for each of these environments is different. The configuration for a production environment for a solution is different than the configuration of a development environment for the same solution. The configuration differences could be in terms of number of virtual machines, the size of virtual machines, the DNS names, the IP address range, and more. The application configuration for each of these environments is also different. For example: the connection string to database, integration endpoints to other systems, and other configurations are different across these environments.
Active management of both the infrastructure- and application-level configuration information as well as data is known as configuration management in software life cycle management parlance.
There are many tools that can help manage configurations across environments. Some of these are open source while others are propriety.
Each cloud provider also has its own configuration-management tools.
Azure provides ARM templates for provisioning and configuring the infrastructure resources. Other cloud vendors provide their own native ways to configure the environments.
Tools such as Desired State Configuration, Chef, Puppet, and Ansible are suitable for application configuration.
ARM templates enable a concept known as Infrastructure as Code; let's understand it in the next section.

Infrastructure as Code

Infrastructure as Code is one of the important facets of configuration-management systems. Generally, an environment is provisioned using manual efforts, such as using a self-service portal or wizard that provides step-by-step directions to configure a resource. It might go a step further and the environment can be provisioned using scripts, such as PowerShell and Bash. These scripts can then execute either manually or automatically using an orchestrator tool.
There are some serious limitations in using any of the previously mentioned approaches:
  • Lack of repeatability, consistency, and predictability during provisioning and updating environments. The configuration values for scripts are either entered manually by copying from documents and Excel sheets.
  • Lack of diagnostic information and it's difficult to figure out the exact error location.
  • Human error while providing configuration values.
  • Lack of confidence in deployments.
  • Lack of efficiency and speed.
These limitations demand using a more systematic and automated approach for the creation of environments and the deployment of applications.
Infrastructure as Code can help remove these limitations. At a high level, Infrastructure as Code refers to the process of defining environments using code and then using it to create environments. However, Infrastructure as Code is much more than this. Infrastructure as Code mandates that infrastructure definitions after it's converted into code should follow the same application life cycle management principles that typically is followed for applications, they are as follows:
  • They should be versioned and stored in a version-controlled repository. Developers should be able to author infrastructure-related code and push them into the repository.
  • The repository helps with collaborating among developers about code related to infrastructure.
  • There should be a process established to verify and validate the changes done to infrastructure code to ensure that only well-tested code is deployed to higher-level environments.
  • After verification, the code should be stored in a place that can be used by all the environments for creation and updates.
  • Configuration information for each environment should be stored alongside the actual infrastructure code. These configurations can then be applied to each environment as applicable.
  • After the infrastructure code is deployed to pre-production and production environments, appropriate operational validation should be conducted to ensure that the environment is behaving as intended and meeting expectations.
  • There should be active monitoring of the environment and any deviation from the known desired configuration should be reported back.
The following screenshot is depicting the process followed for Infrastructure as Code:

What are ARM templates?

ARM templates are JSON files and they enable Infrastructure as Code for Azure Cloud Platform. ARM templates help to provision and configure resources in a predictable, consistent, and repeatable manner.
ARM templates help in the following ways:
  • Specifying resources and their configurations in a declarative manner. There is no scripting involved in provisioning resources.
  • Providing intent and what should be provisioned by defining the resources rather than how to deploy the resources.
  • Offers idempotent deployments by ensuring that the end state of the deployment is always consistent and predictable. This means that even during incremental deployments, the end state will remain consistent. It also means that templates deployed over and over will not change the end result, and environments will be equivalent when used to create multiple environments.
  • Orchestrates the provisioning and configuration process by declaring dependencies between resources.
  • Parameterizes the deployment process by enabling reusability, modular, and generic development.
  • Cross-subscription, cross-region, and multiple resource group deployment and configuration of resources.
  • Enables DevOps in the continuous integration and the continuous deployment of resources and the environment.

Designing ARM templates

ARM templates are one of the foundational pillars for the successful deployment of solutions on Azure. Authoring the right set of ARM templates—that are modular, reusable, and generic—is the first major task for ARM templates. The other aspect is the management and governance of these ARM templates. It is absolutely crucial to design the ARM template in a way that it can evolve over a period of time as well as be managed effectively.
The process for designing an ARM template is as follows:
  • Identification of resources: This is the first step when designing ARM templates for a solution; it involves the identification of resources and their count. There are...

Indice dei contenuti