1 00:00:00,940 --> 00:00:01,550 In this demo, 2 00:00:01,550 --> 00:00:04,980 we'll cover the continuous delivery with Azure 3 00:00:04,980 --> 00:00:07,420 Virtual Machines AZ‑800 objective. 4 00:00:07,420 --> 00:00:09,250 Here we are in the Azure portal. 5 00:00:09,250 --> 00:00:13,480 And remember that the deployment group is a logical collection of VMs, 6 00:00:13,480 --> 00:00:15,420 we're going to assume that they're all in Azure, 7 00:00:15,420 --> 00:00:20,300 that we want to use as deployment targets in our Azure DevOps release pipelines. 8 00:00:20,300 --> 00:00:21,190 So in this example, 9 00:00:21,190 --> 00:00:25,530 let's say we want to include vm1 and vm2 in a deployment group. 10 00:00:25,530 --> 00:00:26,670 One way we can do that, 11 00:00:26,670 --> 00:00:30,510 assuming we already have a connection to Azure DevOps organization, 12 00:00:30,510 --> 00:00:34,270 is that we can go to the VM right in the Azure portal 13 00:00:34,270 --> 00:00:36,480 and come down to Continuous delivery. 14 00:00:36,480 --> 00:00:39,860 Let me clean up the view a little bit here by contracting the settings. 15 00:00:39,860 --> 00:00:43,790 And the way you do this is that when we come from the VM, 16 00:00:43,790 --> 00:00:44,890 like we are here, 17 00:00:44,890 --> 00:00:51,140 we are onboarding the VM and automating the deployment of the setup script that 18 00:00:51,140 --> 00:00:54,520 will handshake the virtual machine into a deployment group. 19 00:00:54,520 --> 00:00:54,940 And again, 20 00:00:54,940 --> 00:00:58,040 I've already set up my link between my Azure DevOps 21 00:00:58,040 --> 00:01:00,020 organization and my Azure subscription. 22 00:01:00,020 --> 00:01:04,220 And the project I'm going to use here is my PartsUnlimited‑GUI project. 23 00:01:04,220 --> 00:01:08,550 And we can either create a new deployment group and join it or join an existing. 24 00:01:08,550 --> 00:01:12,190 And I created a deployment group called AZ800‑DeploymentGroup, 25 00:01:12,190 --> 00:01:17,150 and we're going to connect it to my PartsUnlimitedE2E build pipeline, 26 00:01:17,150 --> 00:01:18,680 and we'll click OK. 27 00:01:18,680 --> 00:01:19,840 So like I said, 28 00:01:19,840 --> 00:01:23,650 Azure is now going to deploy that script file that 29 00:01:23,650 --> 00:01:26,310 onboards this VM to that deployment group. 30 00:01:26,310 --> 00:01:30,100 Now another thing we can do is in the Azure DevOps console here, 31 00:01:30,100 --> 00:01:33,470 dev.azure.com, we can go into our project. 32 00:01:33,470 --> 00:01:36,860 And if we come down into Pipelines here, 33 00:01:36,860 --> 00:01:37,790 Deployment groups, 34 00:01:37,790 --> 00:01:42,720 this is where you can create new and manage existing deployment groups. 35 00:01:42,720 --> 00:01:44,180 I have the one that I created, 36 00:01:44,180 --> 00:01:48,640 and this is a run of that onboarding script that I told you about. 37 00:01:48,640 --> 00:01:52,520 So if you wanted to include on‑premises VMs or VMs in 38 00:01:52,520 --> 00:01:54,380 other clouds in a deployment group, 39 00:01:54,380 --> 00:01:57,750 you would want to run this PowerShell script with elevated credentials. 40 00:01:57,750 --> 00:01:59,710 And at the end of that process, 41 00:01:59,710 --> 00:02:04,150 the system would be registered and available in this deployment group. 42 00:02:04,150 --> 00:02:06,000 Now how do we consume a deployment group? 43 00:02:06,000 --> 00:02:08,430 Well, we do that in the release pipeline. 44 00:02:08,430 --> 00:02:10,720 So let's go in this example project. 45 00:02:10,720 --> 00:02:12,450 I've got a release pipeline here. 46 00:02:12,450 --> 00:02:16,660 And we don't need to get deep into the weeds here because it's out of scope. 47 00:02:16,660 --> 00:02:18,670 You just need, the reason I'm doing this demo, 48 00:02:18,670 --> 00:02:22,690 I'm going a bit above and beyond what you might see on AZ‑800. 49 00:02:22,690 --> 00:02:26,170 AZ‑800 just wants you to understand that one of the options you 50 00:02:26,170 --> 00:02:29,830 have for your Azure VMs is to include them in your release 51 00:02:29,830 --> 00:02:32,140 automation if you're using Azure DevOps. 52 00:02:32,140 --> 00:02:35,630 And the way that works is via the deployment group. 53 00:02:35,630 --> 00:02:37,780 So let me go to my Dev stage here. 54 00:02:37,780 --> 00:02:41,800 And the idea with this pipeline is that we would have a CodeCommit, 55 00:02:41,800 --> 00:02:42,670 a developer, 56 00:02:42,670 --> 00:02:45,760 an infrastructure person would commit a code change 57 00:02:45,760 --> 00:02:47,910 to the Azure Repos code base. 58 00:02:47,910 --> 00:02:50,360 That normally serves as a build trigger, 59 00:02:50,360 --> 00:02:54,340 and that would kick off a software build where we could do unit testing, 60 00:02:54,340 --> 00:02:57,770 and regression testing, and security vulnerability testing, 61 00:02:57,770 --> 00:02:59,050 and these sorts of things. 62 00:02:59,050 --> 00:03:02,770 And then the output of your build pipeline is called a release artifact. 63 00:03:02,770 --> 00:03:03,950 And what we have here, 64 00:03:03,950 --> 00:03:07,500 the release pipeline picks up where the build pipeline leaves off. 65 00:03:07,500 --> 00:03:12,270 That build artifact becomes the deployment trigger into your release process. 66 00:03:12,270 --> 00:03:14,990 And here we've got a staged deployment with three 67 00:03:14,990 --> 00:03:17,900 separate environments in Azure for Dev, QA, 68 00:03:17,900 --> 00:03:19,400 and Production, respectively. 69 00:03:19,400 --> 00:03:22,230 I'm just going to, in this demo, look at the Dev stage. 70 00:03:22,230 --> 00:03:25,430 And in this graphical representation, 71 00:03:25,430 --> 00:03:28,760 there are a number of task scripts that do different things. 72 00:03:28,760 --> 00:03:29,420 For example, 73 00:03:29,420 --> 00:03:33,330 the Azure Resource Group Deployment task allows you to deploy 74 00:03:33,330 --> 00:03:35,880 Azure infrastructure using ARM templates, 75 00:03:35,880 --> 00:03:36,670 simple as that. 76 00:03:36,670 --> 00:03:38,630 In order to connect to your subscription, 77 00:03:38,630 --> 00:03:41,230 you need to create what's called a service connection. 78 00:03:41,230 --> 00:03:43,370 I've already done that, so I'm good with that. 79 00:03:43,370 --> 00:03:48,190 I'm running a deployment, and there is our ARM template and parameter files. 80 00:03:48,190 --> 00:03:51,300 But to tie into a deployment group specifically, 81 00:03:51,300 --> 00:03:55,900 that shows up under Advanced deployment options for virtual machines. 82 00:03:55,900 --> 00:03:59,700 And for Enable prerequisites, this was set to None originally, 83 00:03:59,700 --> 00:04:01,700 I'm doing Deployment Group here. 84 00:04:01,700 --> 00:04:05,840 And then I have to create a service connection specifically for that, 85 00:04:05,840 --> 00:04:10,130 and then I navigated into my team project and to my deployment group. 86 00:04:10,130 --> 00:04:17,000 So this is one example of how deployment groups are surfaced and managed in Azure DevOps.