In Chapter 16, Developing Business Continuity, we looked at how to ensure our solutions have adequate backups in the event that the unexpected happens.
In this chapter, we continue the operational theme, looking at how we can deploy components into Azure, specifically using scripts, templates, and automation tools.
We will begin by exploring what options are available and then start to investigate in more detail how Azure exposes a series of REST APIs. We will then continue looking at using the APIs via command-line tools and Azure Resource Manager (ARM) templates.
Finally, we will look at how to automate deployments using ARM templates and Azure DevOps, along with a brief overview of agile DevOps processes.
We will specifically explore the following topics:
- Exploring provisioning options
- Looking at the Azure RESTful API
- Choosing between PowerShell and Azure CLI
- Understanding ARM templates
- Looking at Azure DevOps
Technical requirements
This chapter will use the Azure portal (https://portal.azure.com) and the Azure DevOps portal (https://dev.azure.com) for examples.
Exploring provisioning options
When building solutions in Azure, the most obvious, and arguably easiest option, is to use the Azure portal.
Although this is great for the quick exploration of components, for learning, or even basic setup, using a manual hands-on approach is difficult to replicate with guaranteed consistency.
What we mean by this is the fact that any manual approach that involves a user clicking buttons or entering information cannot be easily repeated in a way that prevents mistakes from happening. In a traditional on-premises environment, solution builds might be verbosely documented so that other engineers can build the system by following step-by-step instructions.
The major problem with this, aside from the time it takes to write the documentation, is the fact that whoever is following the instructions could very easily enter some information incorrectly, misclick a button, or even miss entire steps.
This can be overcome by opting for a scripted environment. Using scripts, we can attempt to write in code the steps required to build and configure software, and with the advent of virtualization, we can even automate infrastructure in the same way.
Another aspect to consider is how solutions are built, especially when adhering to agile practices. We spoke briefly about waterfall and agile management practices at the very start of this book in Chapter 1, Architecture for the Cloud, and again in Chapter 2, Principles of Modern Architecture, when we spoke about architecting for DevOps.
One of the core tenets of agile development is that we should build small iterations of a solution with regular but incremental deployments. In the same fashion, we may often be called upon to build the supporting infrastructure in the same way.
Manually rebuilding or adding to the infrastructure using the Azure portal simply would not scale and, as already mentioned, is too error prone. Infrastructure therefore needs to be deployed using automation in order to ensure consistency.
All components in Azure can therefore be defined using scripts, and when architecting solutions, we must take into consideration how components will be deployed, as this may have a direct impact on the solution itself.
When deploying components, aside from the portal, we have a number of options, including these:
- Azure REST APIs
- PowerShell
- The Azure Command-Line Interface (CLI)
- ARM templates
- DevOps pipelines
We will explore each in more detail as we progress through this chapter.
Leave a Reply