Book Image

Azure for Architects. - Second Edition

By : Ritesh Modi
Book Image

Azure for Architects. - Second Edition

By: Ritesh Modi

Overview of this book

Over the years, Azure cloud services have grown quickly, and the number of organizations adopting Azure for their cloud services is also gradually increasing. Leading industry giants are finding that Azure fulfills their extensive cloud requirements. Azure for Architects – Second Edition starts with an extensive introduction to major designing and architectural aspects available with Azure. These design patterns focus on different aspects of the cloud, such as high availability, security, and scalability. Gradually, we move on to other aspects, such as ARM template modular design and deployments. This is the age of microservices and serverless is the preferred implementation mechanism for them. This book covers the entire serverless stack available in Azure including Azure Event Grid, Azure Functions, and Azure Logic Apps. New and advance features like durable functions are discussed at length. A complete integration solution using these serverless technologies is also part of the book. A complete chapter discusses all possible options related to containers in Azure including Azure Kubernetes services, Azure Container Instances and Registry, and Web App for Containers. Data management and integration is an integral part of this book that discusses options for implementing OLTP solutions using Azure SQL, Big Data solutions using Azure Data factory and Data Lake Storage, eventing solutions using stream analytics, and Event Hubs. This book will provide insights into Azure governance features such as tagging, RBAC, cost management, and policies. By the end of this book, you will be able to develop a full-?edged Azure cloud solution that is Enterprise class and future-ready.
Table of Contents (17 chapters)

Interacting with the intelligent cloud

Azure provides multiple ways to connect, automate, and interact with the intelligent cloud. All methods require users to be authenticated with valid credentials before they can be used. The different ways to connect to Azure are the following:

  • Azure Portal
  • PowerShell
  • Azure Command-Line Interface (CLI)
  • Azure REST API

Azure Portal

Azure Portal is a great place to get started. With Azure Portal, users can log in and start creating and managing Azure resources manually. The Portal provides an intuitive and user-friendly user interface through the browser. The Azure Portal provides an easy way to navigate to resources using blades. The blades display all the properties of a resource, logs, cost, its relationship with other resources, tags, security options, and more. The entire cloud deployment can be managed through the Portal.

PowerShell

PowerShell is an object-based command-line shell and scripting language used for the administration, configuration, and management of infrastructure and environments. It is built on top of the .NET framework and provides automation capabilities. PowerShell has truly become a first-class citizen among IT administrators and automation developers for managing and controlling the Windows environment. Today, almost every Windows and many Linux environments can be managed by PowerShell. In fact, almost every aspect of Azure can also be managed by PowerShell. Azure provides rich support for PowerShell. It provides a PowerShell module for each resource provider containing hundreds of cmdlets. Users can use these cmdlets in their scripts to automate interaction with Azure. The Azure PowerShell module is available through the web platform installer on as well as through the PowerShell Gallery. Windows Server 2016 and Windows 10 provide package management and PowerShellGet modules for quick and easy downloading, and installation of PowerShell modules from the PowerShell gallery. The PowerShellGet module provides the Install-Module cmdlet for downloading and installing modules on the system.

Installing a module is a simple act of copying the module files at well-defined module locations that can be done as follows:

Import-module PowerShellGet
Install-Module -Name AzureRM -verbose  

Azure Command-Line Interface (CLI)

Azure also provides Azure CLI 2.0, which can be deployed on Linux, Windows, and Mac operating systems. Azure CLI 2.0 is Azure's new command-line utility for managing Azure resources. Azure CLI 2.0 is optimized for managing and administering Azure resources from the command line, and for building automation scripts that work against the ARM. The CLI can be used to execute commands using Bash Shell or Windows command line. Azure CLI is a very famous among non-Windows users as it allows us to talk to Azure on Linux and Mac. Steps for installing Azure CLI 2 are available at https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest.

Azure REST API

All Azure resources are exposed to users through REST endpoints. Representational State Transfer (REST) APIs are service endpoints that implement HTTP operations (methods), providing create, retrieve, update, or delete (CRUD) access to the service's resources. Users can consume these APIs to create and manage resources. In fact, the CLI and PowerShell mechanism uses these REST APIs internally to interact with resources on Azure.

ARM templates

In an earlier section, we witnessed deployment features, such as multi-service, multi-region, extensible, and idempotent, provided by ARM. ARM templates are the primary means of provisioning resources in ARM. ARM templates provide implementation support for ARM deployment features.

ARM templates provide a declarative model through which resources, their configuration, scripts, and extensions are specified. ARM templates are based on JavaScript Object Notation (JSON) format. They use the JSON syntax and conventions to declare and configure resources. JSON files are text-based, human-friendly, and easily readable files.

They can be stored in a source code repository and have version control. They are also a means to represent IAC that can be used to provision resources in an Azure resource group again and again, predictably, consistently, and uniformly. A template needs a resource group for deployment. It can only be deployed to a resource group and the resource group should exist before executing a template deployment. A template is not capable of creating a resource group.

Templates provide the flexibility to be generic and modular in their design and implementation. Templates provide the ability to accept parameters from users, declare internal variables, define dependencies between resources, link resources within same or different resource groups, and execute other templates. They also provide scripting language type expressions and functions that make them dynamic and customizable at runtime.

Deployments

PowerShell allows the following two modes of deployment of templates:

  • Incremental: Incremental deployment adds resources declared in the template that don't exist in a resource group, leaves resources unchanged in a resource group that is not part of a template definition, and leaves resources unchanged in a resource group that exists in both the template and resource group with the same configuration state.
  • Complete: Complete deployment, on the other hand, adds resources declared in a template to the resource group, deletes resources that do not exist in the template from the resource group, and leaves resources unchanged that exist in both the resource group and template with the same configuration state.