Azure ARM

Course
Time
1 hour 19 minutes
Difficulty
Beginner
CEU/CPE
2

Video Transcription

00:02
we have seen how we can manually deploy arm templates from our machine.
00:07
We can use power shell or azure sea life. For that. However, the power of fashion resource manager is not doing my no deployments. It is using automation and setting up, continues integration and continues delivery pipelines that can use the arm templates to deploy infrastructure.
00:26
In this video, we'll see how we can set up as your develops toe deploy our infrastructure.
00:33
The first thing you need to do is you need to create the account for yourself in actual develops. I already have my account created, and also I have created my first project, which is cyber recourses.
00:47
This project will contain your arm scripts, your deployment templates, any other scripts or configuration that you need, and you'll use this project to trigger the pipelines.
01:00
Next, you need to connect your project. Tow the azure subscription where your deployments worker you go inside the project and you click on project settings.
01:11
There you see the service connections part, so please conserve these connections and you can create a new service connection. Thes service connection needs Toby, our show resource manager type.
01:23
It will ask you for the information.
01:26
I will not do that because I already have a connection,
01:30
but I have created previously.
01:34
Next thing is you need to have a depository where you can save the script.
01:40
I have, ah, cyber very arm depository
01:44
where I have all the scripts or deployment templates that I need. So I have the template that we created in the previous lectures. I also have the parameters files that we have created in the previous lectures, and we used for the manual deployments.
01:59
They're too new files inside that we need to look at.
02:02
Let's go to visual studio coat.
02:08
So what are those two new files? The 1st 1 is the Power Shell script that actually does some work for us.
02:16
This power shell script except street ings, a spotter matters the occasion, the up name and the environment. Those are the same things that we accept. Also in our own template.
02:29
The next thing that the Power Shell script does is it registers the resource providers for Microsoft Network and Microsoft storage, which are the resource is that we would like to create with our
02:40
arm template.
02:43
What it also does is it creates a resource group based on some convention that we created. So the Resource group name
02:51
will have up named first. Then it will have the environment, and then it will have the fixed dash R g at the end. So we have a naming convention for the resource group. What this called here, this is it checks whether the resource group exists. If it doesn't exist, it creates it.
03:09
Next thing is great name for the deployment
03:14
and again we use some convention for that. So the name is deployment underscore. And then we get the date
03:22
and the time of the department.
03:24
And the last thing it does is actually triggers the deployment. Using the command let which is new azure resource group deployment the same thing that we did manually impose the information from the current folder and where the deployment
03:44
template this That's why Waas replaces the party matters far with the environment. So we pulled the correct parameters file.
03:53
We use a complete deployment bottom because
03:57
if there is something in the resource group already, we would like to remove it.
04:00
So this is the power shell script that will use to do our deployment.
04:06
The other file is actually a file that defines the pipeline. Normally, that's the foul was called Azure Dash pipelines, don't ya, Moe?
04:15
What it does is it creates a pool or build server with which uses Windows 2009 with Visual Studio 2019 and requires as your power shell.
04:29
Then we create a simple task inside the pipeline, which uses actual power shell task.
04:34
The name of the task is deploy armed template,
04:38
and what we do is we connect using the connection that we created Wash or our subscription
04:45
with the script that we have three ginning is deport template Power Shell, the one that we just looked on and we passed arguments, which our location West US up named Cyber Larry and Environment death.
04:59
Now let's go back to, Ah,
05:01
our develops project and go and configure the pipeline
05:06
so we'll click on Pipelines
05:10
and because we don't have any pipelines created, will click on you Pipeline.
05:16
We'll choose Asher git repositories.
05:20
Yeah, and we'll choose our show, our get depository, where we have our scripts and arm templates.
05:30
It automatically picks the GMO file that we have already created,
05:38
and we can just click run
05:44
so it takes a while until actually one agent becomes available. Sometimes it can take a couple of seconds. Sometimes it can take a little bit longer, like a minute.
05:56
Once the agent is available,
05:58
the job gets triggered and it goes through different faces. So the first thing is it. Initialize is the job, then checks out all the coat, and now it actually deploys the template and we will see that the template
06:13
gets the point. We'll see all the steps that we implemented in the Power Shell script.
06:20
It uses the connection it registers the providers,
06:25
creates the cyber very group. It tells us that it does not exist and creates a new one,
06:30
verifies the template
06:32
and creates the template. Deployment,
06:34
which is deployment, underscore the date and the time. This is the UTC time.
06:43
It takes a while until the resource is on Get deport. The bigger your template is, the more time it may take.
06:51
So as you can see the storage account, God created very fast. Let's switch to the
06:59
Porto. I will refresh here
07:01
and you'll see that we have the cyber very deaf resource group.
07:08
Both three sources are created
07:10
and we can look at the deployments
07:13
and we'll see that we have these departments which succeeded
07:16
going back to the pipeline. Everything succeeded.
07:20
So this is how you can howto make your resource deployments using Asher Dave ops.
07:28
The power of farm is not to trigger manual deployments, but to use automation toe deployed. All the resources that you need Actual tape ops is one way to do that. You can use our other C I C D tools like Travis C. I or Amazons, huh?
07:46
They've works and so on.
07:48
One important thing to note here is that I don't need to run this pipeline manually.
07:54
Every time a committee happens to the master branch, this pipeline will be run automatically in. The deployment will be done in Asher.
08:05
Now, you know how you can use azure develops toe, automate your deployment.

Up Next

Azure ARM

This Azure ARM course will cover the main topics you will need to understand how Azure Resource Manager works and how to develop flexible automation for Azure resource deployments.

Instructed By

Instructor Profile Image
Toddy Mladenov
Instructor