Automating Azure virtual machines using a template reduces mistakes and resources. In this lesson, learn about the structure and components that make an Azure template.
- [Instructor] In this chapter, we're going to focus in on Azure Templates but before we get hands-on we need to discuss why we use Azure Templates, the benefits and then have a quick overview of the key components of a template. to provision several identical servers. And you know what happens next right? The servers are all provisioned but there is a variance between the bills because there is no standard. And everyone has their own take on the requirements. In addition, this process can be time-consuming. And this is where the advantage of templates comes in. When we deploy our virtual machines using the template, it is faster than manually provisioning those virtual machines. And it ensures that the same build is deployed each and every time. We can build template from an existing virtual machine and then modify that template as required. Or there are several QuickStart templates available to us that you can use. Managing virtual machines through template is a three-step process. The first step being, you need to obtain or create a template. Next, you can modify the template and then deploy the template. This is a very simplistic overview of how to deploy template in Azure. We'll get into the nitty-gritty of it Variables, Functions, Resources, and finally Outputs. And we'll now touch on each of these. And the first being the $schema. The $schema is required in your template. It points to where the JSON schema file is located and it describes the version of the template language. Next we have the contentVersion. Again, this is also required. It provides a version of the template and is used for version control. Next we have are Parameters. These are the values to be used when a deployment is executed. And we use Parameters to customize the deployment. Examples of a Parameter would be location or name. This is followed by Variables. And these are the values that are used throughout the template. Examples would be, We also have Functions. When we use a Function, it simplifies complex expressions Next we have Resources. The Resource section defines the resources to be deployed or updated. For example, Microsoft.Compute/virtualMachines. And finally, we have the Output. Which provides the values after You do not have to be a JSON expert in order to manipulate templates for Azure. But having this base understanding is extremely helpful.
- Configuring high availability with availability sets
- Configuring virtual networking
- Deploying scale sets
- Configuring metrics
- Automating Azure deployments with templates
- Creating virtual machines
- Applying PowerShell DSC
- Moving and redeploying VMs
- Managing VM backups