Time
7 hours 58 minutes
Difficulty
Intermediate
CEU/CPE
8

Video Transcription

00:00
Welcome back. In this episode, we're gonna take a look at a demo using containers.
00:05
Our objectives include we're gonna create a container registry, and Azure will create a docker image and uploaded to our registry and then deploy it to a Web app
00:15
before we get started. Most of our other demos have only required access to the azure portal. And using resource is in there for this demo. I do want to point out I am going to be using Docker desktop on Windows. And here is the euro for it to download and install. If you're using a Windows PC
00:30
and you will want to configure it for Lennox Containers, you very well could configure for windows. But in the demo here, I will be using just a Lennox container.
00:39
Now let's get back out to the azure portal and take a look
00:43
back here in the azure portal. First thing we need to do is create a container registry that we can upload our doctor container, too.
00:50
So first, let's create a resource
00:53
will select containers
00:55
and container registry.
01:00
We'll need to give a registry name, and if you notice it has a suffix of dot azure cr dot io. So this does need to be a globally unique name.
01:14
I'm going to select an existing resource group I have created called Docker Dash R G.
01:19
I'm gonna leave the location as East us.
01:22
And for this registry, we're gonna enable the admin user so we can use a user name and admin user key as our log in
01:30
and the registry does come in, a couple available skews. Right now, we're just gonna stick with standard.
01:36
Let's go ahead and create our registry.
01:44
And here we are inside of our container registry that we just created. There's a couple of things in here we need to take note of before we continue.
01:52
First, I need to copy the log in server name. This is the name we just used when we created our registry.
01:57
And in order to log into this registry later so we can upload our doctor image. Let's go to settings and access keys.
02:06
And here I'm gonna copy the user name and the first pass word to use in our demo later.
02:15
Next. Let's go take a look at the application. We're going to create a docker image for
02:22
here. I have these same know Js hello world Web app that we used in our previous demos on Azure App Service's and Web APS
02:30
and I have a new file here called a Doctor file.
02:32
This is basically just a list of Dr Commands that's gonna tell Doctor how to build our image.
02:38
Let's also go look at our index dot Js file and I want to note that instead of hello world, I have hello container app just so we can tell it's a different Web app than the ones we previously built.
02:52
Harry, um, in my power show window. And I've already navigated to the folder that has our application in it and our doctor file. And I've already installed Docker desktop for Windows on this system. Just remember to go back and install it yourself if you want to follow along this demo.
03:07
So first we need to build our doctor image. And to do that, we're going to run this command here.
03:13
I'm going to say Dr Build
03:15
and we're gonna prep end it with the same name as our azure container registry,
03:20
and we just need to give the application of name
03:24
and then the dot here just says include everything in this folder that I currently have with our application files.
03:36
Now, I got just a little bit of a note here saying I have a locked file and I forgot to close out of my index dot Js inside of my code window. So let me do that real quick
03:47
and let's just rerun are built to make sure it runs correctly.
03:53
So let's take a look at the image by running Docker images Command,
03:55
we could see right here the image we just created in our local repositories.
04:00
Now that we have our image, we need to log into our azure container registry so we can push this image to it.
04:08
To do this, we need to use the doctor Logue in command,
04:11
the name of our remote registry,
04:18
and here is gonna prompt for a user name and password. And this is the user name and password we just saw in our access keys just a few moments ago.
04:30
Now that we have our image created and were logged into our remote registry, we just need to push this image to it.
04:40
Well put, Doctor push
04:42
and the name of our image
04:51
and we could see Doctor is pushing the different layers of our application up to our remote registry.
05:03
Now that the push is complete, let's go back to our portal.
05:09
We go down under Service's and select repositories.
05:12
We can see our know Js hello World image has been uploaded here.
05:15
So now that we have an image, let's go overto app service is
05:19
and we're gonna create a new Web based on top of this image.
05:26
It's like my doctor resource group.
05:29
We need to give our Web app a name.
05:34
And previously, when we're deploying our Web APS, we selected code. But this time we're going to select Docker Container. We're gonna run it off the Lenox operating system,
05:45
and we're gonna choose the same region that the registry is deployed to.
05:48
I'm going to use thes, say, map service plan that I created previously
05:53
and next. Let's go to Dr
05:56
and here. Under image source,
05:59
we can select our azure container registry
06:01
and firmer azure container registry is gonna pull up the image that we just created.
06:05
So let's go ahead and click on review and create,
06:10
and we'll wait for a deployment to finish.
06:15
Let's go to our resource now that it's been deployed
06:16
and you'll see this Web app is pretty much the exact same looking as the other ones that we created. Except now, as the Web has been deployed, it already has the code in the application based off the doctor image that we created. So if we go ahead and select on Brows,
06:31
noticed, the Earl has our dash doctor app on it this time, and it has the code that we looked at earlier. Where says Hello container app.
06:40
So in our last demo, with just Web APS, we had to create the Web at first and then find a way to upload code to it. You know, we could do that from Get Hub or some other source in our case, in our demo, we just uploaded it through FTP. But using a docker image, we can deploy the code immediately. When we create the Web app.
06:57
You can also configure integration toe where if you change your application and update the doctor image and push it again, back up to the registry, it will auto update here inside the Web app, so you don't have to manually come deployed again.
07:11
That does it for our containers demo. Let's jump back to the slides and wrap this up,
07:15
but does it for this module. It's a little bit shorter than what we've been working with before. Coming up next, we're gonna jump into our next module, talking about some authentication and data security concepts with an introduction to authentication.
07:28
See you in the next episode.

Up Next

AZ-300: Microsoft Azure Architect Technologies

Azure Solution Architects are responsible for taking business requirements and turning them into solutions. This course provides an introduction into Azure, Microsoft’s cloud platform.

Instructed By

Instructor Profile Image
Jeff Brown
Instructor