The Azure cloud is a collection of resources that work in unison to deliver a product or a service. Hardware is virtual and services can be created and destroyed at the stroke of a key. In the context of DevOps, resources can be "spun up" as part of a pipeline. It is crucial that when resources are deployed multiple times, those deployments are consistent, repeatable, and can be automated. Doing it manually through the Azure portal isn’t practical. Azure Resource Manager (ARM) has an interface for processing resource templates that specify resource deployments.
In this course, we look at how those templates can be built and deployed. We start with a simple template and move on to more complex examples to illustrate many of the useful features available when deploying resources with templates. This course contains plenty of demonstrations from the Azure platform so you can see exactly how to use Azure Resource Manager in practice.
If you have any feedback on this course, please reach out to us at firstname.lastname@example.org.
- Understand what Azure Resource Manager (ARM) is and its use cases
- Learn about the different ARM templates available and how they can be used
- Deploy databases using an ARM template
- Export a template and create templates using QuickStart templates
- Deploy resources using a script
This is a beginner-level course aimed at anyone who wants to learn more about managing and configuring their Azure environment, and fast-tracking their deployments.
To get the most out of this course, you should have a basic understanding of the Azure platform.
So, what is Azure resource manager? Well, it is what it says it is. For a lot of people when they think of Azure they think of the complete Microsoft cloud product and all that it entails. But in reality, Azure is a collection of services or resources. When you sign up to Azure for the very first time as an organization with a new subscription and you log in to the portal there is nothing there. As you require services whether that's a virtual machine, a web app, or database server you create instances of those resources. Azure resource manager is the glue behind-the-scenes that makes it substantially easier for you to deploy and manage all those different resources.
ARM in Context
You might think that the portal is Azure, but the portal is one of several interfaces to Azure resource manager. The portal is merely a graphical interface over the resource manager, which in itself is an interface to the various resources, especially in terms of deployment, and managing the order and dependencies involved in deploying various resources. Apart from the portal, there is also an API interface to Azure resource manager and more importantly for us, an SDK interface.
Command Line Interface
PowerShell for Windows and the Azure command-line interface are the preferred methods for interacting with Azure resource manager when it comes to large, complex, and repeated deployments. One thing I want you to take notice of on the slide is where authentication fits into the scheme. Because there are multiple ways to interact with resource manager authentication is handled directly by it. This is demonstrated by the fact that when you log into Azure through PowerShell or the Azure CLI a browser window will pop up and you can authenticate through that when using two-step authentication or a Microsoft account.
As we can see here Azure resource manager is mostly used when managing resources within a resource group. All resources are created within a group even if they are spread over multiple geographical regions. By grouping resources, you can perform actions on all the resources in that group at one time. A simple example would be creating a database server with databases and a web app service for some testing and then deleting all of them at one time by deleting the resource group that contains them. Having said that depending on the type of billing account you have with Microsoft you can also create subscriptions and management groups through resource manager.
Why You Need to Know ARM
But why do you need to know about Azure resource manager? After all, the portal works just fine and is easy enough to use. Infrastructure as code is the reason. In the cloud, hardware does not exist; everything is virtual and can be defined by code. It's fine for you to deploy a simple resource or even a couple of simple resources using the portal in a one-off situation. But having to set up by hand multiple and complex resources, perhaps several times for different environments, like development test and production, would not only be tedious and time-consuming but also prone to error. You can create resource deployments with scripts and run them through the Azure CLI or PowerShell. As resource creation and deployment are so important Azure has developed templates for defining your resources.
A template is a JSON formatted text specification of a resource. The JSON template file contains all the information about a resource necessary for Azure to create it. It contains vital information like the type of resource, for example, virtual machine, database or storage, and the resource’s name. What resource group, and where the resource should be deployed, as in the geographic region are other configurable attributes in the JSON definition. The template specifies the size of the resource, whether that is disk space for a database or compute power for a virtual machine. As I said, every detail about the resource you want to create, including other resources that the target resource will depend on. A template won’t be that useful if it just specifies exactly the same resource. What I mean by that, is you can’t have resources with identical names. The template architecture allows you to use input parameters to reuse a template to deploy the same type of resource, with a different name and attributes. We will see that all the attributes we choose from drop-down lists, radio buttons, and checkboxes as well as text we enter during the resource creation process in the portal become template parameters.
I’m going to introduce you to templates by creating a virtual machine resource in the portal and then saving the template. We will look at the elements of the template like how a resource is defined and how parameters are used to modify a resource deployment. Creating a VM will also demonstrate how one resource is dependent on other resources. A virtual machine doesn’t exist in isolation, it requires a network and storage in the form of a disk. Don’t worry if you don’t get resource templates after the first demonstration. I will examine the different elements of a template in more detail later. The first demo is to show you the relationship between a resource created in the portal and the corresponding template that gets produced.
Hallam is a software architect with over 20 years experience across a wide range of industries. He began his software career as a Delphi/Interbase disciple but changed his allegiance to Microsoft with its deep and broad ecosystem. While Hallam has designed and crafted custom software utilizing web, mobile and desktop technologies, good quality reliable data is the key to a successful solution. The challenge of quickly turning data into useful information for digestion by humans and machines has led Hallam to specialize in database design and process automation. Showing customers how leverage new technology to change and improve their business processes is one of the key drivers keeping Hallam coming back to the keyboard.