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

  1. 234 pages
  2. English
  3. ePUB (adapté aux mobiles)
  4. Disponible sur iOS et Android
eBook - ePub

Azure Resource Manager Templates Quick Start Guide

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

Ritesh Modi

DĂ©tails du livre
Aperçu du livre
Table des matiĂšres
Citations

À propos de ce livre

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.

Foire aux questions

Comment puis-je résilier mon abonnement ?
Il vous suffit de vous rendre dans la section compte dans paramĂštres et de cliquer sur « RĂ©silier l’abonnement ». C’est aussi simple que cela ! Une fois que vous aurez rĂ©siliĂ© votre abonnement, il restera actif pour le reste de la pĂ©riode pour laquelle vous avez payĂ©. DĂ©couvrez-en plus ici.
Puis-je / comment puis-je télécharger des livres ?
Pour le moment, tous nos livres en format ePub adaptĂ©s aux mobiles peuvent ĂȘtre tĂ©lĂ©chargĂ©s via l’application. La plupart de nos PDF sont Ă©galement disponibles en tĂ©lĂ©chargement et les autres seront tĂ©lĂ©chargeables trĂšs prochainement. DĂ©couvrez-en plus ici.
Quelle est la différence entre les formules tarifaires ?
Les deux abonnements vous donnent un accĂšs complet Ă  la bibliothĂšque et Ă  toutes les fonctionnalitĂ©s de Perlego. Les seules diffĂ©rences sont les tarifs ainsi que la pĂ©riode d’abonnement : avec l’abonnement annuel, vous Ă©conomiserez environ 30 % par rapport Ă  12 mois d’abonnement mensuel.
Qu’est-ce que Perlego ?
Nous sommes un service d’abonnement Ă  des ouvrages universitaires en ligne, oĂč vous pouvez accĂ©der Ă  toute une bibliothĂšque pour un prix infĂ©rieur Ă  celui d’un seul livre par mois. Avec plus d’un million de livres sur plus de 1 000 sujets, nous avons ce qu’il vous faut ! DĂ©couvrez-en plus ici.
Prenez-vous en charge la synthÚse vocale ?
Recherchez le symbole Écouter sur votre prochain livre pour voir si vous pouvez l’écouter. L’outil Écouter lit le texte Ă  haute voix pour vous, en surlignant le passage qui est en cours de lecture. Vous pouvez le mettre sur pause, l’accĂ©lĂ©rer ou le ralentir. DĂ©couvrez-en plus ici.
Est-ce que Azure Resource Manager Templates Quick Start Guide est un PDF/ePUB en ligne ?
Oui, vous pouvez accĂ©der Ă  Azure Resource Manager Templates Quick Start Guide par Ritesh Modi en format PDF et/ou ePUB ainsi qu’à d’autres livres populaires dans Informatique et Cloud Computing. Nous disposons de plus d’un million d’ouvrages Ă  dĂ©couvrir dans notre catalogue.

Informations

Année
2019
ISBN
9781789612271
Édition
1
Sous-sujet
Cloud Computing

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...

Table des matiĂšres