WEBVTT

0:00:02.980000 --> 0:00:07.400000
 Hi, in this video on virtual machine
 extensions, we're going to take a

0:00:07.400000 --> 0:00:12.380000
 look at what extensions are and how
 we can use them to really automate

0:00:12.380000 --> 0:00:15.340000
 the configuration of
 our virtual machines.

0:00:15.340000 --> 0:00:18.680000
 In this video, we're going to take
 a look at, well again, what virtual

0:00:18.680000 --> 0:00:22.300000
 machines extensions are and we're going
 to look at two common virtual

0:00:22.300000 --> 0:00:23.460000
 machine extensions.

0:00:23.460000 --> 0:00:28.160000
 We're going to take a look at desired
 state configuration or DSC and we're

0:00:28.160000 --> 0:00:32.800000
 going to take a look at custom script
 and then I'm going to demonstrate

0:00:32.800000 --> 0:00:38.500000
 a DSC extension extension.

0:00:38.500000 --> 0:00:42.120000
 All right, let's go ahead and
 let's jump right into this.

0:00:42.120000 --> 0:00:46.460000
 Now what are virtual
 machine extensions?

0:00:46.460000 --> 0:00:51.380000
 If you think about a virtual machine
 and deploying a virtual machine,

0:00:51.380000 --> 0:00:58.080000
 I can pan up here, right, when you deploy
 a virtual machine, you are deploying

0:00:58.080000 --> 0:01:01.820000
 the virtual machine.

0:01:01.820000 --> 0:01:07.980000
 You are deploying it based
 on some image, right?

0:01:07.980000 --> 0:01:13.060000
 So I have an OS disk and that OS disk,
 whether it's a marketplace image

0:01:13.060000 --> 0:01:25.660000
 or a custom image, marketplace image
 and effectively what's happening

0:01:25.660000 --> 0:01:28.840000
 is that image is being, you're making
 a clone of that and setting up and

0:01:28.840000 --> 0:01:30.840000
 becomes your OS disk, right?

0:01:30.840000 --> 0:01:35.640000
 But when you think about Azure in general,
 right, we talk about two things

0:01:35.640000 --> 0:01:43.080000
 with Azure. We talk about the control
 plane and we talk about the data

0:01:43.080000 --> 0:01:50.180000
 plane, right? And the control plane,
 it's really all of these resources

0:01:50.180000 --> 0:01:55.360000
 and that's typically what you think about
 with Azure is that I'm provisioning

0:01:55.360000 --> 0:01:58.580000
 virtual machines, I'm setting up their
 characteristics, I'm even provisioning

0:01:58.580000 --> 0:02:02.420000
 and setting up the basic
 attributes of an OS disk.

0:02:02.420000 --> 0:02:07.920000
 But what I'm not typically doing with
 Azure is I'm not going down into

0:02:07.920000 --> 0:02:12.020000
 that OS disk and I'm not configuring
 it by doing things like installing

0:02:12.020000 --> 0:02:17.220000
 software, setting OS level configurations,
 patching it, right?

0:02:17.220000 --> 0:02:21.360000
 That's what I might consider the
 data plane for a virtual machine.

0:02:21.360000 --> 0:02:24.260000
 It's usually talked about with data
 systems like Azure SQL Database, but

0:02:24.260000 --> 0:02:27.920000
 the same kind of split
 applies, right?

0:02:27.920000 --> 0:02:31.920000
 But there are so many instances when
 you are deploying a virtual machine

0:02:31.920000 --> 0:02:34.540000
 that you want to be able to automate
 the configuration of that, right?

0:02:34.540000 --> 0:02:36.360000
 Think about disaster recovery.

0:02:36.360000 --> 0:02:39.600000
 I've got virtual machines that are
 running critical workloads, I need

0:02:39.600000 --> 0:02:44.260000
 to be able to quickly respawn those
 or reprovision those somewhere else

0:02:44.260000 --> 0:02:46.940000
 if necessary and I really want
 them to be fully configured.

0:02:46.940000 --> 0:02:49.300000
 The last thing I'm going to do at three
 o'clock in the morning, which

0:02:49.300000 --> 0:02:53.320000
 of course is when all emergencies happen,
 is I don't want to have to be,

0:02:53.320000 --> 0:02:56.460000
 you know, bleary-eyed in trying to
 remember all the settings, right?

0:02:56.460000 --> 0:02:58.160000
 I want to be able to
 just push that out.

0:02:58.160000 --> 0:03:02.420000
 And obviously if you're in IT,
 all kinds of systems for that.

0:03:02.420000 --> 0:03:09.940000
 What we have in Azure is we have
 this concept of extensions.

0:03:09.940000 --> 0:03:24.080000
 And really what extensions do, very
 simply, is they allow you to inject

0:03:24.080000 --> 0:03:29.660000
 configuration into the OS level
 of a virtual machine, right?

0:03:29.660000 --> 0:03:32.860000
 So now we're taking that configuration
 down beyond the standard control

0:03:32.860000 --> 0:03:39.700000
 plane and truly customizing the workload
 of your virtual machine.

0:03:39.700000 --> 0:03:42.800000
 There are many different
 extensions.

0:03:42.800000 --> 0:03:46.140000
 There are, as we'll see, there's
 a desired state configuration.

0:03:46.140000 --> 0:03:49.920000
 If you're familiar with PowerShell DSC,
 it actually works for both Windows

0:03:49.920000 --> 0:03:54.120000
 and Linux. There's a custom script
 extension, which will allow you to

0:03:54.120000 --> 0:03:58.460000
 deploy either PowerShell scripts or even
 command line scripts in the Windows

0:03:58.460000 --> 0:04:02.960000
 side or shell scripts and other
 variations on the Linux side.

0:04:02.960000 --> 0:04:06.580000
 And there's so many others, for example,
 to the Microsoft Word talking

0:04:06.580000 --> 0:04:07.900000
 about puppet and chef.

0:04:07.900000 --> 0:04:11.860000
 If you use either one of those management
 tools for virtual machines,

0:04:11.860000 --> 0:04:15.720000
 configuration tools, you can actually
 have agents automatically installed

0:04:15.720000 --> 0:04:17.220000
 based on these extensions.

0:04:17.220000 --> 0:04:19.040000
 And that's really what
 an extension is.

0:04:19.040000 --> 0:04:23.540000
 And for me, the fact that we've got the
 two kind of more open and customizable

0:04:23.540000 --> 0:04:29.280000
 ones, the DSC, which is going to allow you
 to have really kind of an infrastructure

0:04:29.280000 --> 0:04:36.200000
 as code thing where I'm defining a
 really a file that defines a state

0:04:36.200000 --> 0:04:37.620000
 of the virtual machine
 that I want.

0:04:37.620000 --> 0:04:41.460000
 And I can apply that with DSC or any
 kind of script that you want, as

0:04:41.460000 --> 0:04:44.600000
 long as you can script it, automate
 that script, you can use it to set

0:04:44.600000 --> 0:04:46.380000
 up your virtual machines.

0:04:46.380000 --> 0:04:51.680000
 All right, now, we're going to talk about
 one of the types first, desired

0:04:51.680000 --> 0:04:53.980000
 state configuration, DSC.

0:04:53.980000 --> 0:04:57.740000
 Desired state configuration
 is extremely powerful.

0:04:57.740000 --> 0:05:02.340000
 It is also typically used by
 a fairly small set of people.

0:05:02.340000 --> 0:05:06.860000
 This is one of those things where if
 you use DSC frequently, you are going

0:05:06.860000 --> 0:05:08.220000
 to absolutely love it.

0:05:08.220000 --> 0:05:12.680000
 If you're just trying to find a solution
 for automated configuration,

0:05:12.680000 --> 0:05:16.280000
 DSC may appear a little bit daunting
 at times, and I will tell you that's

0:05:16.280000 --> 0:05:18.440000
 a little bit of instructor
 opinion.

0:05:18.440000 --> 0:05:24.020000
 And for me, it's a weird, it's a little
 bit of a weird amalgam of PowerShell

0:05:24.020000 --> 0:05:29.400000
 and concepts in PowerShell with actually
 JSON formatting, although not

0:05:29.400000 --> 0:05:31.700000
 quite exactly either of
 those pretty close.

0:05:31.700000 --> 0:05:34.660000
 Anyways, what is desired
 state configuration?

0:05:34.660000 --> 0:05:35.700000
 How does that work?

0:05:35.700000 --> 0:05:39.600000
 Well, okay, if you wanted to deploy
 desired state configuration, let's

0:05:39.600000 --> 0:05:43.960000
 say, for example, that you were
 doing this in a template.

0:05:43.960000 --> 0:05:47.960000
 This is actually a template section,
 so this is not DSC, this is just

0:05:47.960000 --> 0:05:53.260000
 a template. And so the way you would do
 that, anytime you have an extension,

0:05:53.260000 --> 0:05:58.240000
 there's going to be a name which is
 usually indicative of what it is.

0:05:58.240000 --> 0:06:05.600000
 The type here simply extensions depends
 on, and you've got the name of

0:06:05.600000 --> 0:06:08.640000
 it's going to depend
 on a virtual machine.

0:06:08.640000 --> 0:06:10.620000
 And then you have the properties.

0:06:10.620000 --> 0:06:15.880000
 This is Publisher, the type is DSC,
 type handler that's going to be fun

0:06:15.880000 --> 0:06:18.640000
 to find if you don't already have it,
 usually you're going to let it auto

0:06:18.640000 --> 0:06:21.880000
 upgrade. Those are all
 pretty easily findable.

0:06:21.880000 --> 0:06:28.500000
 Where it gets interesting is in this
 section right here, configuration

0:06:28.500000 --> 0:06:32.600000
 of the extension.

0:06:32.600000 --> 0:06:35.780000
 Every extension may have a slightly
 different configuration.

0:06:35.780000 --> 0:06:41.100000
 In this case, what you're going to
 do is you're going to pull up a zip

0:06:41.100000 --> 0:06:47.040000
 file that has the proper configuration
 for a DSC file.

0:06:47.040000 --> 0:06:51.540000
 And within that zip file, you're going
 to specify what it's going to run,

0:06:51.540000 --> 0:06:55.620000
 and there should be within that zip file,
 a script file, DSC in this case

0:06:55.620000 --> 0:07:01.240000
.ps1. And what function within that script
 file you want to run, any additional

0:07:01.240000 --> 0:07:06.920000
 parameters and if you have
 protected settings.

0:07:06.920000 --> 0:07:10.840000
 So things like SAS keys
 if they are necessary.

0:07:10.840000 --> 0:07:13.720000
 Now what is an actual DSC file?

0:07:13.720000 --> 0:07:19.040000
 Here is an example, all written
 over by my mad markings.

0:07:19.040000 --> 0:07:26.600000
 There we go. This is the internals
 of maybe that DSC.ps1 file.

0:07:26.600000 --> 0:07:29.460000
 Here I've got the configuration
 main, that's my function.

0:07:29.460000 --> 0:07:33.040000
 It's taken a parameter, which is node
 name, which is actually used right

0:07:33.040000 --> 0:07:39.720000
 here. Now the node allows you to have
 multiple configurations within a

0:07:39.720000 --> 0:07:43.420000
 single file. So if I wanted a single
 file to configure, say web servers

0:07:43.420000 --> 0:07:47.060000
 and database servers with different
 configurations, I could have them

0:07:47.060000 --> 0:07:51.200000
 differentiated by node, which
 is based on attributes.

0:07:51.200000 --> 0:07:53.780000
 In this case, it's just going to be
 the name, which is passed, and it's

0:07:53.780000 --> 0:07:56.780000
 going to absolutely just
 go ahead and install it.

0:07:56.780000 --> 0:07:59.900000
 You could also just say node local host
 and it would always install it.

0:07:59.900000 --> 0:08:04.120000
 Now what's important is
 this bit right in here.

0:08:04.120000 --> 0:08:09.300000
 I've got the Windows feature, web
 server role, name and ensure.

0:08:09.300000 --> 0:08:13.380000
 And these guys right here,
 web server and present.

0:08:13.380000 --> 0:08:18.640000
 Web server is the official service
 and error feature name of IIS.

0:08:18.640000 --> 0:08:23.100000
 And this is saying I would
 like that to be present.

0:08:23.100000 --> 0:08:27.320000
 Next, it says okay, and we're going
 to add something else here, and that

0:08:27.320000 --> 0:08:29.100000
 is a management console.

0:08:29.100000 --> 0:08:32.440000
 And also I want the management service,
 which is a control service for

0:08:32.440000 --> 0:08:35.480000
 IIS. This is just installing
 some IIS stuff.

0:08:35.480000 --> 0:08:39.000000
 Now here's the thing that I will say
 is kind of fun, is trying to figure

0:08:39.000000 --> 0:08:42.660000
 out what the names of
 are of the features.

0:08:42.660000 --> 0:08:45.780000
 And really the only way I've found to
 do that is go to machine that has

0:08:45.780000 --> 0:08:49.620000
 the features installed, and there's
 a PowerShell commandlet that you can

0:08:49.620000 --> 0:08:53.560000
 use on a Windows server to
 list the features by name.

0:08:53.560000 --> 0:08:56.760000
 And you just pick up the name
 and you would use that here.

0:08:56.760000 --> 0:09:03.420000
 Or even better, you go out and you look
 for an existing example of a DSC

0:09:03.420000 --> 0:09:05.820000
 file that does what
 you want it to do.

0:09:05.820000 --> 0:09:08.680000
 And it's really kind of the
 easiest way to do that.

0:09:08.680000 --> 0:09:10.480000
 All right, so that's desired
 state configuration.

0:09:10.480000 --> 0:09:14.280000
 Very powerful. Might also be a little
 foreign to you if you've never worked

0:09:14.280000 --> 0:09:19.360000
 with it. The next is a little more conventional,
 and that's a custom script.

0:09:19.360000 --> 0:09:22.440000
 And starting out, you see that
 we've got the same markup.

0:09:22.440000 --> 0:09:25.100000
 So this would be the deployment
 in a template.

0:09:25.100000 --> 0:09:27.680000
 There are other ways to deploy, by the
 way, you can deploy from the command

0:09:27.680000 --> 0:09:31.700000
 line using either PowerShell or the CLI,
 and you can also deploy directly

0:09:31.700000 --> 0:09:35.800000
 from the portal, although the rules
 are a little bit different there.

0:09:35.800000 --> 0:09:38.840000
 All right, now the name of this, and I
 actually want to point out a difference

0:09:38.840000 --> 0:09:43.280000
 in this name. Notice this name right
 here, myvm slash custom script one.

0:09:43.280000 --> 0:09:46.900000
 In the previous example, it was
 just the name of the script.

0:09:46.900000 --> 0:09:49.640000
 Here it's myvm slash in the name.

0:09:49.640000 --> 0:09:55.900000
 That's important because it is really
 a sub resource or a sub object of

0:09:55.900000 --> 0:09:57.260000
 the virtual machine.

0:09:57.260000 --> 0:10:02.720000
 In the previous example, that resource
 deployment would have been basically

0:10:02.720000 --> 0:10:08.260000
 underneath of or inside of the template
 for the virtual machine.

0:10:08.260000 --> 0:10:13.160000
 The virtual machine template deployment
 has its own resources, and you

0:10:13.160000 --> 0:10:16.640000
 can put dependent resources
 or sub resources in that.

0:10:16.640000 --> 0:10:19.920000
 Here, I'm deploying this script
 completely independently.

0:10:19.920000 --> 0:10:25.080000
 This might be the only thing
 in a deployment template.

0:10:25.080000 --> 0:10:27.220000
 And what that's doing is saying, okay,
 if I have a virtual machine named

0:10:27.220000 --> 0:10:29.380000
 myvm, that's where I'm
 installing this.

0:10:29.380000 --> 0:10:31.000000
 And that's just a
 naming convention.

0:10:31.000000 --> 0:10:35.280000
 For example, if you're adding a subnet
 to an existing virtual network,

0:10:35.280000 --> 0:10:39.260000
 it would be virtual network
 name slash subnet.

0:10:39.260000 --> 0:10:43.960000
 Easy enough, the type is the same
 type, generic extensions.

0:10:43.960000 --> 0:10:48.220000
 Then you go down to the properties,
 publisher, OSTC extensions.

0:10:48.220000 --> 0:10:53.140000
 In this case, it's a custom
 script for Linux.

0:10:53.140000 --> 0:10:59.060000
 And then you've got the type handler
 version, you've got a great minded

0:10:59.060000 --> 0:11:04.960000
 version true. And then you've got the
 file URIs that you want to deploy.

0:11:04.960000 --> 0:11:13.180000
 In this case, I've got a URI that's sitting
 in a blob container that has,

0:11:13.180000 --> 0:11:18.920000
 in this case, it allows for public anonymous
 access to the actual blob,

0:11:18.920000 --> 0:11:22.320000
 so I don't need any kind of
 SAS or key to get to it.

0:11:22.320000 --> 0:11:25.460000
 And then you have to deploy
 a command to execute.

0:11:25.460000 --> 0:11:29.400000
 Now I will tell you that in addition
 to the SH, there would be another

0:11:29.400000 --> 0:11:33.000000
 one that I would need to put in here,
 which would be the actual file that

0:11:33.000000 --> 0:11:36.380000
 the web server install
 actually installs.

0:11:36.380000 --> 0:11:43.940000
 So that is the concept behind
 a custom script installation.

0:11:43.940000 --> 0:11:52.140000
 Now let's take a look at an example
 of that particular custom script.

0:11:52.140000 --> 0:11:58.800000
 There we go. So this actually
 is that script file.

0:11:58.800000 --> 0:12:04.420000
 And what this does is it makes a directory
 on whatever server it's on.

0:12:04.420000 --> 0:12:06.200000
 It goes to that directory.

0:12:06.200000 --> 0:12:09.260000
 It pulls down a file.

0:12:09.260000 --> 0:12:11.840000
 I forgot I did this one right.

0:12:11.840000 --> 0:12:15.520000
 Then it sets that file to be runnable,
 and then it runs the file.

0:12:15.520000 --> 0:12:18.780000
 Now, if this were complete, I would
 also make sure that that's set up

0:12:18.780000 --> 0:12:20.860000
 in the auto start for
 the Linux machine.

0:12:20.860000 --> 0:12:25.360000
 But that would get you a very basic web
 server installed onto that particular

0:12:25.360000 --> 0:12:33.100000
 machine. Now what I'm going to do is I'm
 going to demonstrate a DSC extension.

0:12:33.100000 --> 0:12:38.820000
 I'm actually going to do this from scratch
 in my Visual Studio code that

0:12:38.820000 --> 0:12:41.940000
 I'm just using as a tool
 to build up from nothing.

0:12:41.940000 --> 0:12:45.520000
 It's kind of a cool tool, but the tool
 itself, maybe something you want

0:12:45.520000 --> 0:12:49.060000
 to use, but that's not what's important,
 what's important is the end product.

0:12:49.060000 --> 0:12:52.780000
 So let's go ahead and let's
 pop over to that.

0:12:52.780000 --> 0:12:55.600000
 And we'll just get
 rid of this guy.

0:12:55.600000 --> 0:13:01.280000
 All right. Here I've got
 my Visual Studio code.

0:13:01.280000 --> 0:13:02.940000
 VS code, again, this is free.

0:13:02.940000 --> 0:13:04.460000
 It's cross-platform.

0:13:04.460000 --> 0:13:09.980000
 You've got it on Windows and
 Linux and also on Mac OS.

0:13:09.980000 --> 0:13:13.560000
 And by the way, you can actually pull
 it up in the Azure Cloud Shell as

0:13:13.560000 --> 0:13:16.520000
 well. It's not as functional
 there, but it does exist.

0:13:16.520000 --> 0:13:21.060000
 All right. So what I'm going to do here
 is I'm going to just go with deploy

0:13:21.060000 --> 0:13:31.840000
 extension. We'll say DSC.json.

0:13:31.840000 --> 0:13:40.520000
 And then we're going to come over here
 and I'm going to use some snippets

0:13:40.520000 --> 0:13:48.240000
 to give me first the basic
 structure of my file.

0:13:48.240000 --> 0:13:52.480000
 I've got schema content version, parameters,
 variables, resources, outputs.

0:13:52.480000 --> 0:14:00.720000
 I'm going to go into the resources
 and I'm going to go arm VM windows.

0:14:00.720000 --> 0:14:02.880000
 I'm going to pop that in.

0:14:02.880000 --> 0:14:07.380000
 Now I am going to do this
 fairly quick and dirty.

0:14:07.380000 --> 0:14:12.020000
 And as much as I'm not going to do what
 I usually do and put in variables,

0:14:12.020000 --> 0:14:14.520000
 it's kind of not really the point.


0:14:14.520000 --> 0:14:18.460000
 The point is really just to
 show you the extension.

0:14:18.460000 --> 0:14:22.860000
 Okay. So as much as I'm cringing at
 these names, we're going to go ahead

0:14:22.860000 --> 0:14:27.800000
 and go with it. I am going to take
 out the DNS extension there.

0:14:27.800000 --> 0:14:39.540000
 And then my virtual network, we're going
 to leave just exactly as it is.

0:14:39.540000 --> 0:14:44.620000
 Network interface, also going
 to leave it exactly as it is.

0:14:44.620000 --> 0:14:50.160000
 Then I go down into
 my virtual machine.

0:14:50.160000 --> 0:14:51.700000
 Notice it's Windows VM1.

0:14:51.700000 --> 0:14:53.420000
 Again, we're just going
 to leave it there.

0:14:53.420000 --> 0:14:57.740000
 I do need to remove the dependency on
 the storage because it doesn't exist

0:14:57.740000 --> 0:15:05.640000
 anymore. And I need to actually
 take out that which required it.

0:15:05.640000 --> 0:15:11.280000
 All right. I'm going to put in a bad
 password here because I'm being again

0:15:11.280000 --> 0:15:13.720000
 exceptionally lazy.

0:15:13.720000 --> 0:15:19.280000
 There we go. I'm going to give
 an exclamation mark as well.

0:15:19.280000 --> 0:15:22.400000
 I never actually use
 that password.

0:15:22.400000 --> 0:15:24.040000
 So if you think, hey, cool.

0:15:24.040000 --> 0:15:24.700000
 Now I can break in.

0:15:24.700000 --> 0:15:25.660000
 No, you really can't.

0:15:25.660000 --> 0:15:27.240000
 Not that you would.

0:15:27.240000 --> 0:15:29.760000
 But I only use that in examples.

0:15:29.760000 --> 0:15:32.940000
 I'm going to delete immediately
 after creating them.

0:15:32.940000 --> 0:15:34.840000
 All right. OS this name.

0:15:34.840000 --> 0:15:36.900000
 Again, not to roll with
 it, but we'll go.

0:15:36.900000 --> 0:15:37.920000
 Boot diagnostics.

0:15:37.920000 --> 0:15:44.980000
 I have to set that to false because I'm
 not actually storing boot diagnostics.

0:15:44.980000 --> 0:15:53.000000
 OK. Then I also need to clean up this
 resources section here because I'm

0:15:53.000000 --> 0:15:57.540000
 also not doing any diagnostics.

0:15:57.540000 --> 0:15:59.820000
 All right. Kind of
 a minimal install.

0:15:59.820000 --> 0:16:04.200000
 Awesome. Now that would, if I ran this
 right now, this would give me a

0:16:04.200000 --> 0:16:08.120000
 virtual machine and everything that
 I need in the virtual machine.

0:16:08.120000 --> 0:16:10.760000
 But what I want to do.

0:16:10.760000 --> 0:16:16.940000
 See, I think we have DSC.

0:16:16.940000 --> 0:16:21.800000
 There we go. Arm VM DSC.

0:16:21.800000 --> 0:16:25.820000
 OK. So I pop that in there
 and it's its own resource.

0:16:25.820000 --> 0:16:28.000000
 Notice the name there.

0:16:28.000000 --> 0:16:32.160000
 Windows VM DSCrypt
 1, VM1 DSCrypt 1.

0:16:32.160000 --> 0:16:37.320000
 And that is actually the name of the
 virtual machine that's given, which

0:16:37.320000 --> 0:16:39.020000
 again, we're just going
 to leave it as is.

0:16:39.020000 --> 0:16:44.020000
 But what's important is that's the link
 between this desired state configuration

0:16:44.020000 --> 0:16:47.820000
 script and the actual
 virtual machine.

0:16:47.820000 --> 0:16:50.300000
 And display name I'm fine with.

0:16:50.300000 --> 0:16:52.640000
 It depends on the virtual machine.


0:16:52.640000 --> 0:16:54.860000
 Is a PowerShell DSC.

0:16:54.860000 --> 0:17:02.540000
 And I need the modules URL.

0:17:02.540000 --> 0:17:12.960000
 Now for the modules URL, I actually
 have an IIS deployment file set up.

0:17:12.960000 --> 0:17:14.840000
 I just need to pull it up.

0:17:14.840000 --> 0:17:22.760000
 It's already deployed.

0:17:22.760000 --> 0:17:30.020000
 And node name is fine.

0:17:30.020000 --> 0:17:31.140000
 Don't need the SAS token.

0:17:31.140000 --> 0:17:39.700000
 And the configuration function
 is, pull this guy up here.

0:17:39.700000 --> 0:17:40.340000
 Just so I can show you.

0:17:40.340000 --> 0:17:42.140000
 This is actually the zip file.

0:17:42.140000 --> 0:17:44.260000
 I'm going to pull this over.

0:17:44.260000 --> 0:17:46.120000
 That I'm deploying.

0:17:46.120000 --> 0:17:50.340000
 This is actually the contents
 of the zip file itself.

0:17:50.340000 --> 0:17:52.660000
 These guys out of the way.

0:17:52.660000 --> 0:17:55.200000
 And I've got this IIS install.

0:17:55.200000 --> 0:17:57.480000
 The DSC metadata is just in there.


0:17:57.480000 --> 0:18:00.380000
 That's just part of
 creating the file.

0:18:00.380000 --> 0:18:02.780000
 And if I open this up, we'll
 open up with VS code.

0:18:02.780000 --> 0:18:14.200000
 Why not? This is the actual
 DSC configuration file.

0:18:14.200000 --> 0:18:16.920000
 Notice that the configuration
 is main.

0:18:16.920000 --> 0:18:19.620000
 So the file is IIS install.ps1.

0:18:19.620000 --> 0:18:22.200000
 And the configuration is main.

0:18:22.200000 --> 0:18:29.020000
 And it's got the node name is getting
 passed down when it's called.

0:18:29.020000 --> 0:18:32.100000
 It's got the web server, web management,
 web management services, and

0:18:32.100000 --> 0:18:38.820000
 ASP net 4.5. It actually has a whole
 lot of other commented out features.

0:18:38.820000 --> 0:18:40.360000
 These are kind of
 standard features.

0:18:40.360000 --> 0:18:44.660000
 This file is one that I actually generated
 from standard visual studio.

0:18:44.660000 --> 0:18:46.400000
 I just use it all the time.

0:18:46.400000 --> 0:18:48.860000
 And you can find lots
 of examples out there.

0:18:48.860000 --> 0:18:51.220000
 OK. I don't want to save
 any changes I made.

0:18:51.220000 --> 0:18:54.960000
 But I do want to go back here.

0:18:54.960000 --> 0:18:56.500000
 Leave that open just
 so I don't forget it.

0:18:56.500000 --> 0:19:04.420000
 So the configuration function
 is, I can get it there.

0:19:04.420000 --> 0:19:10.100000
 The configuration
 function is main.

0:19:10.100000 --> 0:19:15.080000
 Now, I do want to show you something
 again really quickly.

0:19:15.080000 --> 0:19:21.020000
 Just a little bit of a difference
 in the way that this is presented.

0:19:21.020000 --> 0:19:25.020000
 If you take a look at the example
 that I showed you before.

0:19:25.020000 --> 0:19:26.820000
 I've got this section here.

0:19:26.820000 --> 0:19:28.640000
 This is a little bit different.

0:19:28.640000 --> 0:19:31.680000
 The settings, I've got a configuration,
 I've got a URL, a script, and

0:19:31.680000 --> 0:19:37.620000
 a function. And if I take that and look
 at that relative to what we see

0:19:37.620000 --> 0:19:40.860000
 here, what we see here is really
 just a little bit different.

0:19:40.860000 --> 0:19:46.480000
 And I will tell you, I actually am going
 to use the one from the slide.

0:19:46.480000 --> 0:19:50.380000
 And just kind of copy it over
 and replace what's there.

0:19:50.380000 --> 0:19:53.500000
 Again, just different approaches
 to the same thing.

0:19:53.500000 --> 0:19:56.100000
 I'm just a little more
 used to this one.

0:19:56.100000 --> 0:19:58.980000
 So my settings is going
 to be configuration.

0:19:58.980000 --> 0:20:01.440000
 I can grab that.

0:20:01.440000 --> 0:20:06.360000
 I'm through arguments.

0:20:06.360000 --> 0:20:12.020000
 And I'm just going to replace
 this section in here.

0:20:12.020000 --> 0:20:19.500000
 In fact, format that out.

0:20:19.500000 --> 0:20:22.180000
 And then once again, get that URL.


0:20:22.180000 --> 0:20:23.620000
 So that's one thing.

0:20:23.620000 --> 0:20:31.080000
 There are definitely some differences
 in the way that the markup, the

0:20:31.080000 --> 0:20:34.600000
 JSON, the template can be defined.


0:20:34.600000 --> 0:20:37.420000
 And just keep in mind that doesn't, you
 know, don't let that make it harder

0:20:37.420000 --> 0:20:42.180000
 on you. This is just honestly kind
 of the way that I had learned to do

0:20:42.180000 --> 0:20:44.160000
 it probably because frankly
 it came from Visual Studio.

0:20:44.160000 --> 0:20:47.100000
 Visual Studio code, they put in
 a slightly different approach.

0:20:47.100000 --> 0:20:50.040000
 And that is fine.

0:20:50.040000 --> 0:20:54.660000
 Now the only other thing that I have
 here is this configuration node name.

0:20:54.660000 --> 0:21:07.780000
 That's actually going to be just
 the name of the Windows VM1.

0:21:07.780000 --> 0:21:12.240000
 Okay. So I now have settings.

0:21:12.240000 --> 0:21:16.280000
 I believe should be correct if I
 would stop hitting the wrong key.

0:21:16.280000 --> 0:21:20.480000
 Telling me that it's not
 happy with settings.

0:21:20.480000 --> 0:21:26.140000
 That's fine. Should be good.

0:21:26.140000 --> 0:21:34.420000
 And save. Okay. So now I'm going
 to go ahead and deploy this.

0:21:34.420000 --> 0:21:37.160000
 Before I deploy it, there's
 another demo there.

0:21:37.160000 --> 0:21:39.180000
 And clear that. It's
 not in the way.

0:21:39.180000 --> 0:21:41.440000
 Although it is always
 good to see a success.

0:21:41.440000 --> 0:21:48.380000
 All right. First thing I'm going to do
 is create a new AZ resource group.

0:21:48.380000 --> 0:21:58.560000
 Name VM extension demo.

0:21:58.560000 --> 0:22:01.980000
 Location as always.

0:22:01.980000 --> 0:22:09.280000
 East US. And we have that.

0:22:09.280000 --> 0:22:20.760000
 Okay. Now I'm going to create a new
 AZ resource group deployment.

0:22:20.760000 --> 0:22:35.860000
 Name DSC resource group name
 is VM extension demo.

0:22:35.860000 --> 0:22:42.360000
 Mode is incremental.

0:22:42.360000 --> 0:22:50.320000
 Say there we go.

0:22:50.320000 --> 0:22:53.440000
 Deploy extension DSC.

0:22:53.440000 --> 0:22:57.680000
 Go. And. That was fun.

0:22:57.680000 --> 0:23:02.340000
 I have too many virtual machines
 running right now.

0:23:02.340000 --> 0:23:05.580000
 I'm going to go fix that
 and come back and run it.

0:23:05.580000 --> 0:23:09.120000
 And again, fortunately for you, this
 will waste none of your time.

0:23:09.120000 --> 0:23:12.280000
 All right. So the way I fix that was
 there's a couple ways I could have

0:23:12.280000 --> 0:23:15.980000
 fixed that. One, I could have gone and
 deleted whatever virtual machines

0:23:15.980000 --> 0:23:17.900000
 I had of that size.

0:23:17.900000 --> 0:23:21.180000
 Two, I could have gone and requested
 an increase in my quote of that size.

0:23:21.180000 --> 0:23:24.820000
 Or three, which is what I did because
 it's the easiest thing to do.

0:23:24.820000 --> 0:23:31.060000
 I could have gone and modified the template
 to deploy a VM size that I've

0:23:31.060000 --> 0:23:33.480000
 upped the quote a bit
 for quite a bit.

0:23:33.480000 --> 0:23:35.760000
 So we're going to try the
 same template again.

0:23:35.760000 --> 0:23:38.320000
 I'm going to deploy it again.

0:23:38.320000 --> 0:23:42.180000
 And I did not deploy
 it with verbose.

0:23:42.180000 --> 0:23:44.140000
 So it's not going to tell me
 that it's going too much.

0:23:44.140000 --> 0:23:45.500000
 This will take a couple minutes.

0:23:45.500000 --> 0:23:55.860000
 And once it's done, we'll come back
 and take a look at the result.

0:23:55.860000 --> 0:23:57.600000
 All right. Look at that.

0:23:57.600000 --> 0:23:59.060000
 We have success.

0:23:59.060000 --> 0:24:03.280000
 Now, if I'm being completely honest,
 which I really should be, we did

0:24:03.280000 --> 0:24:05.160000
 not initially have success.

0:24:05.160000 --> 0:24:09.700000
 And I cheated. But the only reason
 we didn't have success is because I

0:24:09.700000 --> 0:24:11.140000
 forgot to update.

0:24:11.140000 --> 0:24:17.020000
 One thing. And that was that the script
 that came across was just DSC,

0:24:17.020000 --> 0:24:21.500000
 whereas I wanted to do that.

0:24:21.500000 --> 0:24:23.760000
 So there we go. We've got that.

0:24:23.760000 --> 0:24:28.720000
 Let's go take a look at what we actually
 have, what was generated there.

0:24:28.720000 --> 0:24:32.740000
 Let's just go to our
 virtual machines.

0:24:32.740000 --> 0:24:36.840000
 So it took that opportunity to delete
 a bunch of virtual machines because

0:24:36.840000 --> 0:24:38.700000
 they're just costing me money.

0:24:38.700000 --> 0:24:42.540000
 All right. And there's my extension
 demo, Windows VM1.

0:24:42.540000 --> 0:24:51.680000
 And if I go down to extensions, it should
 show me that script has in fact

0:24:51.680000 --> 0:24:59.180000
 installed. And make sure I don't have
 any, I can't remember, I don't have

0:24:59.180000 --> 0:25:02.320000
 DSC or don't have NSG
 rules, which is good.

0:25:02.320000 --> 0:25:05.020000
 I mean, it's not good generally,
 but it's good for this demo.

0:25:05.020000 --> 0:25:10.180000
 Copy that. And let's see if
 IIS actually got installed.

0:25:10.180000 --> 0:25:12.240000
 I really hope it did.

0:25:12.240000 --> 0:25:14.840000
 There you go. Pulled up.

0:25:14.840000 --> 0:25:16.120000
 Got to the IIS screen.

0:25:16.120000 --> 0:25:19.860000
 That means that that extension
 has properly installed.

0:25:19.860000 --> 0:25:24.680000
 It has injected the configuration,
 the DSC configuration, so that the

0:25:24.680000 --> 0:25:28.400000
 virtual machine now has
 IIS installed on it.

