Time
7 hours 46 minutes
Difficulty
Intermediate
CEU/CPE
8

Video Transcription

00:00
Hello and welcome back to Cyber Aires. Microsoft Azure Administrator A Z one of three course. I'm the instructor, Will Carlson. And this is Episode seven Armed templates and baseline.
00:11
In today's episode, we're gonna talk about some of the many benefits of armed templates were gonna look a quick way to get started using them without having to create them from scratch with quick start templates.
00:22
We're also gonna talk about the syntax of the armed template so we can understand what's really going on in a template when we look at it and we're gonna talk about a really powerful feature of armed templates when we use them to baseline our current environment.
00:36
So to get started, what are some of the benefits of armed templates? And
00:39
I guess the best place to start is to explain that an armed template is what's being created by and for the arm, a p I. Every time we do anything in portal
00:51
and the azure portal we're clicking on buttons were filling in fields, and it's generating an arm template.
00:58
This arm template is a Jason document or Java script object notation. Ultimately, it's just a text file telling the arm a p I what it is that we want built.
01:07
So in Azure, we're deploying infrastructure as code, and doing that alone increases consistency of our deployments because we can deploy that code ah, 100 times, and it's gonna look the same every single time. That consistency leads to fewer errors in our deployments, and
01:26
being able to click a button and deploy resource is makes us much more efficient as administrators.
01:33
Using infrastructure is code also gives us the ability to do code reuse. And why this is important is for reasons a lot surrounding a version ing or think get hub. Since we're deploying code
01:46
as a simple text file, we can manage those text files and all the version control's role forwards rollbacks across the globe. That version control gives us
01:57
another benefit here of using infrastructure is code via the armed templates is much more simplified orchestration.
02:04
I'll talk quite a bit in the course about a development team example, but let's assume we have a development team that when they do testing need 30. Resource is spun up an I t. And the I t environment. They don't need them all the time. They only need them when they're doing testing. But there's enough resource is there that it's relatively complicated to spend them up manually every single time
02:24
through the use of an arm template. I can click a button, and it's gonna deploy that 30 resource environment for development every single time. I literally click a button and walk away. Hopefully, you can see
02:37
there are a lot of benefits to arm templates, and it's worth our time. Is administrators, even if we're not doing the easy one of three exam toe, understand what they are and what they do. And to get started, we're gonna go ahead and dive into the azure quick start templates Web page, and
02:51
this is gonna be a host of templates that are already created to do so many different things.
02:58
You can search through here 789 templates as of today, but since this is community driven, it is constantly growing. If there's something you want to do, an azure, check the quick start templates first and see if it's already being done.
03:12
If it's not being done exactly. If you know how to manage and edit the armed templates, you're likely can tweak the template to do exactly what you wanted to do.
03:21
We're gonna go ahead and click on one of these. We're gonna deploy and even to be m with the docker engine.
03:28
This tells me a little bit about it. We'll explain some of this and what this means here on this page. But to get started, we're gonna go ahead and just deployed to Azure.
03:37
Go ahead and sign into my azure account,
03:40
and that brings me into the template deployment window. Now, we're gonna look at the template here real quick and talk about what makes up this template. And we're looking at the Jason of the deployment template right now. And
03:53
at the top here is gonna be schema. You'll see this in every template. This is just their reference for the syntax of the template itself. In what version of choosing
04:02
his content version here is going to be for the template designer or for yourself just for reference so you can keep up what version of the template you're using.
04:12
And we're really gonna get into the interesting part of templates here, starting with parameters and parameters are going to be things that are set at runtime. So when we deploy this template, these parameters were going to have to fill it.
04:25
And to show you those real quickly make note here of
04:29
D. N s name for public i P.
04:31
So when I come back out here to the deployment screen well, see, here's the parameter and it's asking me to set it.
04:38
Ram eaters can specify drop down lists and the values and them Ramblers can specify a whole host of metadata, including tool tips and other things. But if we come back here,
04:49
we can talk through a little bit about what a parameter looks like. So this D. N s name for public I p is a string, and the metadata here is just the description that was pretty straightforward. But when we jumped down to the U Bahn to OS version,
05:02
you can see it's a string with a default value. The matter data includes the description, which is just the tool tip.
05:09
And then there are also some allowed values. So although the parameters allow me to configure the template of deployment time, they still box me into a series of approved options here as well and
05:21
what parameters really do is they allow me to use this template for more use cases than just one. Now, I could hard code these parameters as variables and not give the end user any input, which may be what you do for your own environment. But
05:39
for a public template, clearly they're gonna want me to be able to set some things unique for my environment and
05:43
parameters of the way that you do that
05:46
mentioned variables and variables in a template are going to be just like variables and many other programming languages. They're gonna be things that are used throughout the template, multiple times in multiple places.
05:57
Knowing about variables here in armed templates is important because you may not want to follow this naming scheme that the template designer put in place so I can come in here and change the name of the Nick. I can come in here and exchange and change
06:12
the name of the VM itself all by changing variables.
06:16
Something else will see here in this arm template are gonna be resource is, and these are the actual resource is that are ultimately being deployed here in Azure.
06:26
Now the Jason for these may not make sense, but as we go throughout the course, you can come back to these armed templates and what's here. We'll make a whole lot more sense, but
06:34
very simply, we can see that this is a Microsoft dot network. Is the service provider which will talk more about this Is assigning a public I. P. Address. The name for this is pulling from a variable. Its location is also pulling from a parameter set. It run time. And here's some properties of that public I p address.
06:55
There are some other things that we don't see in this particular template that can be included. And those were going to be
07:00
functions and outputs and functions in a resource and armed template are gonna be functions just like in any other scripting language, little tidbits of code that you can reuse over and over. And outputs are gonna be things useful. For example, if we make this deployment and I wanted to call a Web hook
07:16
to make a documentation in my I t sm system that this deployment was done and we have new resource is too man.
07:25
So again, schema, content version parameters and variables. Resource is what we see here. Functions and outputs are gonna be things that you may also see as well.
07:35
And when I come back out to deploy this solution, all I have to do is click purchase.
07:41
Now it's good to know and be able to read through an arm template, because some of these templates include other things that are going to be paid. Service is in some third party solutions as well. So before you deploy quick start template, it's always a good idea to familiarize yourself with what's actually going to be deployed.
07:58
Fill the form out, filling all the parameters that are required. Click purchase, and it's going to make this deployment and my azure ecosystem. Now
08:05
there's another way to do this as well. We can come up here to create a resource and search for templates.
08:13
It's like template, deployment and hit create.
08:16
Now you can build your own template. You can start with a common template, or you can load templates from the get up. Quick start templates here is well,
08:24
so using templates to manage deployments is really powerful, but an equally powerful solution is going to be based lining using these arm templates. And to show you that we're gonna go ahead and click down here into a resource group.
08:35
We're gonna go to this site resource group. And if I click on deployments here within this resource group, I can see all the deployments that remain within his resource group.
08:46
I click on this very 1st 1 That was when this resource group was created and I launched this woman to be M
08:54
and I go to Template. I can see the template that was used to deploy this resource group initially so I could basically roll back the deployment to the initial deployment. So great if I messed something up, but
09:07
not so great. If I want to redeploy all of these deployments again, I'd have to do them all individually. Which is not the most powerful way to do this.
09:15
There may have been hundreds of deployments in some of your resource groups as they age in production. So then what if I want a baseline, this entire resource group and all the deployments in it? I can click on export template
09:28
and the army p I is going to create for me on armed template for this current resource group. Now know there are some types. It can't be exported, but they weren't included. You can see more about those specific area details. Nonetheless, fixing three resource types that weren't included in this export is a lot better than rebuilding this environment from scratch
09:48
every single time.
09:50
Included here are gonna be the parameters. Are is a separate file and also how I could use this deployment or this arm template via any of these four methods ruby dot in that power shell or via the CLI. An alternative option would be just to deploy it here from the portal.
10:07
This would deploy another copy of this environment right here in port.
10:11
They could even more powerful feature, however, would be to add this arm template to library and all they have to do here is given a name and a description and save it
10:22
to see where that was created. I can come here to all service's and search for templates,
10:26
go into templates, and we can see that template that I created is right here ready to be deployed again. So
10:33
literally, guys, in about 15 seconds, I just took a snapshot of the entire resource group in all the resource is in it and created a way to deploy that all over again. So put that back in the reference of our 30 resource development team.
10:48
Example. So you get a series of specks in front of you of what they're going to need. You build that environment and is that ever perfect the first time? Not in my experience, at least. So you'll build the initial deployment, and then they're gonna be changes in tweaks and need to be made until things are exactly like the development team might want.
11:07
So you're an azure once that's all done. I can take a snapshot of that and baseline that environment, save it here for a deployment, and that allows me to spin this up in a moment's notice with a couple clicks of a button and I can walk away.
11:20
Better yet, still, when the development team are done with these resource is, I can completely delete them for my azure ecosystem altogether, and I don't have to pay for them until I need them again.
11:31
Surely you can see at this point how powerful arm templates are, and I hope you're encouraged to learn about them so you can leverage some in your admin life and to help you better understand
11:41
content for the easy one of three exam.
11:43
So today we talked about how armed templates are put together and what the schema is, all the important parts and pieces of an armed template, how it does its work.
11:52
We talked about why you should bother with armed templates at all, because it's something else new to learn and maybe a new way of thinking about deploying infrastructure for you. But it's very much worth it.
12:01
Talked about some easy ways to get started with the template, so you don't have to create templates from scratch. There are pushing 1000 templates already available for you to use and learn about. And we also talk about the powerful ability to use arm templates to take a snapshot of your current environment so you could deploy it at a future date.
12:20
Coming up next, we're gonna talk about some potential gotchas around quotas on resource quotas here in the azure ecosystem, and we're also gonna talk about a powerful way to help you organize. Your resource is in Azure called tagging.
12:33
Thanks for joining me today. I'm really looking forward to the next episode

Up Next

AZ-103 Microsoft Azure Administrator

This is a training course for the Microsoft Azure AZ-103 Certification. The Microsoft Azure Administrator training course teaches students to perform tasks like managing Azure subscriptions and resources, implementing and managing storage, deploying and managing virtual machines (VM) and networks, and managing identities!

Instructed By

Instructor Profile Image
Will Carlson
Director of IT and Cybersecurity
Senior Instructor