Microsoft Azure AZ-801 — Section 16: Migrate workloads from previous versions to Server 2022, IIS workloads, & AD DS Part 3

Microsoft Azure AZ-801 — Section 16: Migrate workloads from previous versions to Server 2022, IIS workloads, & AD DS Part 3

97. Overview of Azure Containers

So there have been very many breakthroughs and obviously the computer industry all these years from, of course, introducing computers in general back decades and decades ago to personal computers coming out. And then eventually the idea of networking everything together and having global based networks such as the Internet. And then finally virtualization comes out and it shows us that we can have what are called virtual machines that can run on a single computer. You have multiple operating systems running on that single computer in a virtual machine. Well, here is sort of the next type of technology that’s really started to take off and become popular. It’s called Azure Containers. And I’d like to go through and help you understand that before we jump in and dig into the actual concepts and how we do it in Azure.

So, first off, what is a container? Well, you know what a shipping container is, right? You know, you have these massive boats that carry these shipping containers, you have trains and all that carry these. You have trucks that carry these across the road. And these containers can contain all sorts of different objects. Right. Well, let’s take that thought process, that analogy, and let’s kind of convert it over to computers. And the idea of containerization in computers is that we can take what is called a package of software, right? And that can be put inside of a container. This package of software, this container can bundle everything that’s needed to run this application. All right. So, all the code and the required files, the operating system, libraries, if you think about it for a moment, you think about like what? What allows an application to run on a machine, like a web based application. You have to have an underlying operating system. You have to have the web service, you have to have dynamic link libraries, at least in the Windows world or even in the Linux world. You have library based files that are going to make things run. And in order to make those things run, generally speaking, all that’s got to sit right there on an operating system and everything works together to allow that application to properly function. Right. What if you could take all the ingredients that are needed to run a web based application, the required application files, the required operating system files, the library files, interact with the operating system, and you could package those up into what is called a container. Well, if you can do that, which you can, I know that’s not a spoiler alert. You can when you have that container, that container can basically be built anywhere you want and it can then be moved around anywhere you want. And as long as it’s running on a proper operating system, an engine that can run it, it’s going to run just like it did upon its creation. The only difference is you can run a container on more powerful hardware.

So, you might have built the container on a lower powered computer, but then that has very limited memory and processing power. But then all of a sudden you could run that container on an extremely powerful environment that’s elastic, you know, where your scale setting multiple containers in large amounts out there for the Internet to use.

So, this is the idea. This is the beauty of what containers are really bringing to the table.

Why are they so helpful? Well, I’ve kind of described that a little bit, but let’s kind of dig in a little bit more. You know, you have issues with applications and, you know, one of the problems you have with applications is applications will get installed on an operating system and then eventually that operating system ages the company that supports the operating system, like Microsoft, may drop support for it after a while. The applications may not run and even web based applications, you can run across this problem as technologies get upgraded and certain things get dated and you start running into security issues and all of these things with containers you’re dealing with all of that containers can be very lightweight. They can have all the required files contained inside this container, and then you just need an engine that can run it, such as Docker. But I’ll explain Docker a little bit more in just a moment. All right. The other thing is you’re able to provide these Docker containers, these applications that are running inside of what is called a container as a service. You have what’s called an application as a service that’s independent of the foundational operating system that it’s running on. All right. The containerized applications can also be tested and built on a base computer. You could do it in the comfort of your own home, sitting in front of your own computer, be building a container that’s going to be running across, you know, 1000 nodes in a cloud service.

So, it’s a really nice way of being able to build these things, test these things, and then also allow these different containers to last much-much longer in the environments that we’re going to be using them. And not to mention we can secure containers, we can lock things down on the inside and provide a quite a big layer of security for those.

So, let’s look at containers versus virtual machines. All right.

So, this first this first example here, we’re just kind of focused on virtual machines. And you can see in the little graphic there, we have our host operating system. And then on top of that, we might have or we have our host, our actual hardware. And then on top of that, we have our host operating system and the operating system files and libraries. And of course, when this became popular as we moved into the early 2000s and virtualization became very popular, this just blew everybody’s minds because we had situations where, maybe, we had server operating systems that had applications that would only that couldn’t work together. Like, for example, the Microsoft world, you couldn’t really install an exchange server and a SQL server together on the same hardware, even if you had extremely powerful hardware, because the two, the two would mix services and it could cause issues and things wouldn’t work properly. But with the creation of virtualization, I could have a powerful server and I can have one virtual machine running on that server that’s running SQL and another that’s running exchange and everything can work together. And with virtualization, virtual machines, it makes it easy for us to provide redundancy. However, one of the big issues you have there is virtual machines have their own operating systems. You have a lot of duplication going on. You have lots and lots of the same operating system files found in each virtual machine across the board, and they are dependent though the applications that are running on that operating system are dependent upon that operating system. And in a lot of cases, it makes it very, very difficult if you ever have to move the application to a different server, the migration of that application could be very, very difficult. All right.

So, on the flip side of this, one of the benefits of using a virtual machine is that you have complete control over it. You have complete control over the operating system and the hardware and all the files that go along with it. Or as you’ll see with containers, you may not have control of the underlying operating system that it’s running on. For example, I’m hosting a container out in the cloud. Microsoft is going to have control over the underlying operating system, whether it’s a Windows-based operating system or a Linux based operating system. And you really don’t get to do much to that underlying operating system. You only have control over the container files. So, there are you know, there’s ups and downs to this, but the positives of moving into containers you’ll see usually outweigh the negatives.

So, let’s now let’s take a look here at the container side of things.

So, you see in this graphic here, you’ll see how the host hardware you have a host in VM operating system files and library. The one thing the little graphics not showing here is there would be some kind of container engine that can interact with the containers and that would be something like Docker being the most popular. All right, so the container verbalizes the underlying operating system files and these underlying operating system files, whether it’s Linux or whether it’s Windows will interact with that container engine that’s running on the host operating system. All right.

Now, I will say this. When you build a container, if you’ll either be building A or if you’re building it or if somebody else has built it, I should say, where whether you’re doing it yourself or somebody else, the container will be built for a specific operating system. And the Azure environment supports Windows-based and it supports Linux based. All right. And so the container that’s going to have a Windows, that’s let’s say it’s going to run IIS, it’s going to have Internet information services, which is Microsoft’s Web server. It’s going to have to sit on top of a Windows host operating system. If it is a Linux based system, maybe, you’re dealing with Apache or, maybe, you’re dealing with Engine X or whatever Web service, you’ll be dealing with that underlying operating system.

So, Apache, I might be I’ll be interacting with Linux, for example, as the underlying operating system, even though I do know that there is a version of Apache that works with Windows. This being a microsoft class, though, we’re the Windows world, we generally be working with IIS Internet Information services. All right. So, these containers, you can have multiple containers that can span a single host operating system. The other thing is you can have duplicate containers on the same operating system and they can load balance. If you’ve got a powerful server that’s running in the cloud, you’ve got lots of memory, lots of processing power. You can have multiples of the same container that’s running.

So, if you look at my graphic there, you’ll see I have container one and container one I’ve. Two versions of container one sitting there and traffic can be load balanced to those containers. Of course, you also and this graphic isn’t showing that, but you can actually have multiple nodes, meaning actual other virtual hosts that are hosting those same containers. And this gets into the last elasticity side of it where we can grow out and have multiple machines that are hosting containers and then shrink back when we no longer need that.

Now, you heard me mention Docker a couple of times. Docker is the it’s not the only type of container based engine, but it has become sort of the de facto engine that everybody uses. Originally, Docker started out with only supporting Linux and they kind of just took the world by storm. I kind of, you know, I look at them and I think about the fact that they kind of started small and they grew and grew and grew with just using Linux. All right. It kind of reminds me of VMware back in the day virtualization. VMware didn’t create virtualization, but VMware put virtualization the map. And I kind of think about that with Docker. Docker has sort of put containers on the map and Docker originally just supported Linux and Microsoft hooked up with them and funneled a lot of money into them and then they eventually started supporting Windows as well. But Docker and Azure work really well together. You can see the benefits and the integration benefits of Docker and Azure are pretty much the same. You get support for Linux and Windows flexibility to support the microservices and traditional app workloads, integrated graphic user interface. You have our back so you can do role based access control and it integrates with Azure AD and end to end security model. It all kind of integrates together and works together.

Docker is the major engine that runs it. You can actually go out to the Docker website, docker.com, you can download and install Docker on your computer, you can build your own container images, not to mention there are there’s a whole community of people out there building container images that you can download and play around with and you could utilize in your cloud environment if you wanted to. All right.

Now, when it comes to producing a container out there on Azure, there are two major ways that we can do this. All right. The first way and the most simplistic way we can put containers into Azure is what is known as an Azure container instance, HCI. So, HCIs going to be the quickest and easy way if you just if you’re just going to host a one or two or three or just a few containers out there in Azure and you want to do it fast and you want to keep it simple and you want to keep it affordable, then HCI Azure container instances is going to be the way to go. All right. It’s a very quick way to put containers out there, Docker containers, it supports the Docker engine and all that. And you can have containers out there and make them even highly available. So, load balanced and everything. So, they got fail there. You got failsafe capabilities. If, if a container, virtual machine or something fails, you can have redundancy with that kind of like with skill sets on our Azure VMs. But instead of Azure VMs, you’re dealing with these containers. Granted, the containers are also running on underlying VMs. You just don’t have any control really of those VMs, the operating systems or any of that.

Now, you can also see here that if you are going to be growing this too large to a large scale. Then and you’re going to be dealing with lots and lots and lots of container images. Then you might want to move to what is known as a case. This is Azure Kubernetes service. All right.

So, I said there was two major ways that we can deal with containers there. There was Azure container instances. And then finally, there is Azure Kubernetes Service X.

Now, Azure Kubernetes. Kubernetes was originally created by Google, but Google kind of opened a source it up to the world, and Microsoft and some of the other companies like Amazon and all them, they jumped on board with it. And Microsoft has got their own version of it now called Azure Kubernetes. And what this is, is this is for major orchestration of containers, meaning you’ve got a large amount of containers you’re dealing with and you need to grow those or shrink those at any given time.

So, if you’re talking like you’re dealing with hundreds of containers or 1000 containers or whatever, you’re having to deal with and you’re having to grow and shrink all this out and you need a lot to be able to schedule that and have lots of rules on when to grow out, when to shrink and the management, all of that will. That’s going to be the Azure Kubernetes service, the access. That’s what’s going to do that. It is more expensive. It is definitely harder to work with and harder to use. But in the end, you know, when you’re is the term orchestration, it’s like dealing with if you were the conductor of an orchestra, you are dealing with a person playing a violin and a person playing a cello and a person playing a bass and all of that, then it’s like instead of just playing with three instruments, you’ve got a full blown orchestra that you’re having to conduct. And so access is the thing that’s going to be able to do that. It’s going to be able to handle that on a much, much larger scale. All right. So, those are going to be your two major ways that you can use containers. And hopefully that now gives you a good understanding or at least a base understanding of the purpose of containers and some of the different options we have with containers.

98. Migrate IIS workloads to containers

Let’s talk about using containers to host a website force or web application.

So, we have the ability to use what is known as containers. Right? And Docker is by far the most popular technology when it comes to containers. Now, this is not really a Docker course, so you really just getting an overview here. There are entire courses on Docker if you want to become an expert on Docker. But essentially what you do is you can download Docker to your Windows environment and you can install your website into a Docker container.

So, it’ll build you a container, you can install your website into a Docker container and at that point you can upload that container into Azure and, and host your IIS web service in that container within Azure.

So, in order to do that, of course we build our container, which I’m not getting into here. This is not a Docker class, but you can download, you could download Docker install it, build a container out of it. There’s lots of information how to do that. And then from there I would go to the menu button here on Azure. This is portal.azure.com. I would go to AD DS, do all services and just do a search for the word container. And then from there you’re going to see container instances.

So, you would click on container instances and then I would click container to create a container instance. All right, let’s say you call it a resource group. I’d create a resource group called My Containers. RG for Resource Group, it’s just my little naming convention I’m using here. And then the container name, I’ll just call this my Docker container website. All right. Oh, forgot. That’s right. You can’t have any uppercase characters in that name. Yep. Azure is very good about telling you not to use capitalization.

So, then we’ll go here and call just us. We’re not going to do availability zones.

Now, you can start. With a quick start image if you want, which I’ll do. But you also can upload your container through what’s called a container registry. You can use Microsoft’s Azure Container Registry. You can register that go here and it tells you how to register that. But you can also just start with a quick start image and then you can switch out with whatever container you want.

So, I’ll go quick start and then here’s the size you can alter the size of the virtual machine if you want. This is this is also a little bit cheaper than going to the app service in a lot of cases. And then you can set the networking up here if you’re going to have a public address, DNS label, all of that and we’ll click Review and create. And we’ll go ahead and click create. And I will just pause the recording while that’s happening. All right.

So, our little container has been set up and we can click go to Resource and you can see if I you can see the virtual CPU and all that memory running for it. So, it’s very-very quick, quick to set up a web based container using the, the, the Azure container instance method. You don’t have as much control over things as you do with the app service plan. So, if you play around with app services, you definitely have more control, although App service is a little more expensive too.

So, you know, you give up some of the control using the app service plans and ease of use, using the app service plans to use containers, but you can build out the container any way you want using Docker. Once you learn how to use Docker, you can see the container instance right here. This is the container that’s being ran. But again, if you were to build your own container with Docker, when you go to add a container, let’s go back over here to let’s go back home, let’s go to container instances here and let’s say we’re going to create a new and I could have very easily when I go to create a container, I could choose I could actually set up my container into what’s called the Azure Container Registry. I could upload that, but you can also just pull your container from somewhere else. Like if the container was hosted on, if you if you stored the container on your own website temporarily, you could specify the URL for that and you could have it pull the container that way in here and import it in this way and then create the container. And you can very easily get that do that. You can also use you can also do work with containers using the cloud shell. Microsoft has a document. If you do a quick search on deploy a container instance in Azure using Azure CLI, they don’t have a lot of documentation PowerShell with containers. There’s not because Containers has all been built originally off of Linux and it’s just over these last few years they started supporting Windows. Microsoft started working with Docker to, to support Docker containers. But you can you go through the process of working with containers and deleting containers and all of that using the Azure CLI. And that’s really where your control comes from is the Azure CLI. When it comes to containers, there’s not as much graphical support as I think a lot of people would want. I think it would be very helpful to be able to just click on this and then wipe out a container and re upload a container a lot easier. You can do that with app service plans. But again, working with that service plan is a little more expensive than working with containers. Containers is going to just basic containers using the Azure Container Service. The container instance service is going to be a cheap solution.

Now, something I’m not really going to get into a great deal here. I will say this just for the sake of it, though, is that if you’re working with lots of containers. Microsoft has something more robust than the than the Azure container instance method. They have something called Kubernetes. And Kubernetes is built in a situation where I am working with a relatively big environment. I can use the Kubernetes services and use what’s known as Arc’s Azure Kubernetes service. And this will let you build out hundreds and hundreds of containers of different virtual machines. Load balancing and all that. And it’s what we call an orchestrator.

So, it orchestrates large amounts of containers to work together in harmony using load balancing and redundancy capabilities and all of that. It’s a pretty big deal. There are entire courses on nothing but Kubernetes. It’s a huge deal.

If you’re in a large environment and you want to you want to really get down and dirty with containers, Kubernetes is going to be the way to go. But it’s kind of outside the scope of what we’re getting into here. Not anything you need to worry about as far as what we’re learning here. But I did want to at least mention it for anybody that might be in a very large environment that’s working with a lot of containers or needing to work with a lot of containers. I would look into container into Kubernetes. And again, there’s even courses you can get on Kubernetes just by itself, not to mention lots of YouTube content out there on it if you’re wanting to learn it.

Hopefully, that gives you an idea now of how we can work with containers to manage our eyes websites.