 Hello and welcome to this video mini-series. This is the part one of journey of an app, where we'll be showing how to move an application from a Windows Server 2012 R2 running on-premises to a container running all the way in Azure Kubernetes Services or AKS. My name is Vinicius Apollinario. I'm a Senior Program Manager in the Windows Containers Team, and let's get started by showing what we have today. Here I have a Windows Server 2012 R2 server running on-premises, and I have IIS installed and my application is already deployed here. If you want to try out this process using the same application that I'm using, you can also do that using the application Vinibir, that is available on my GitHub. You can see the link and the details on how to deploy this in the blog post that is accompanied in this video. Like I said, this is a video series where we'll be showing how we're going to take this application all the way from this IIS server, deploying in a container, validating that the application is working correctly. We'll be pushing this application to Azure Container Registry, and then we'll be deploying this on Azure Kubernetes Service. In this first video, we'll be showing how to containerize the application itself using Windows Admin Center. To get started, let's actually check if the application is running correctly. As you can see, the application is deployed just like any IIS website. I can open my browser here and it can navigate to the local host. If I open, for example, the calculator page, it shows me that this page at least is working fine. If you're not familiar with this application, basically what it does, the application calculates how much sugar you have to put in in your home brewing process for brewing beer at home. Depending on the style of the beer that you have, for example, I have this half-advise in here. Let's say the temperature of the room that I'm going to be storing this beer is 70 degrees, and I'm going to make at home five gallons. There you go. The application is processing for me. Everything is fine. Just so you know, this application is part of a sample, of an old sample ASP.NET application running in Windows Server 2012 or two. It could be running in 2016 or even all the way back to 2008 or two. Just to show that my application is actually running fine, it's running on-premises as I mentioned, and I want to modernize this application using Windows containers. The first step that I'm going to use in particularly this process is to actually export the application from IIS. Depending on the application you have, if it's not IIS, there will be many ways to export your application. In the case of IIS itself, we can use web deploy to do that because now Windows Admin Center can actually read the zip file from a web deploy and actually create the container image all the way from the zip file to the container image working. I'm going to explain that in a second. For now, let's just export the application. To do that, I have web deploy installed along with IIS, so I can click Export Application when I select the application itself, and what web deploy will do is you actually look at the deployment of the application on IIS, which is this one, and then it will also look at the file system where the application is actually stored. You can see that I have all the files of my application sitting in whatever folder it's sitting in the server. Web deploy will take care of that, and I can go ahead and click Next. Here are the parameters for the server. There's a destination on which this application is going to be imported then. In our case, it's the container itself. In this case, this application is a very simple application. It's just the ASP.NET application, but doesn't have a database connection, for example. Your application might have one. One of the things you want to check is, do you want to keep talking to the same SQL server or the database connection that you have, or once you move the application to a container, do you need to change the database connection? You can actually do that here in the container that you have at the end of the day, will actually follow the configuration of the web deploy itself. You can, for example, add a parameter, and then I can select what is the connection string, what is the value for that database connection string that I'm configuring. If it's a SQL Express, a SQL database, whatever database it is, that you have a configuration, you can change or you can actually keep the same configuration. You would see the configuration for the database connection here if you had that configured already. Very well. I can go ahead and click Next. I can select where I'm going to deploy this, and I actually have a file here, so I'm going to skip this for now. Let me just show you the file that I have. Web deploy generates a zip file once that wizard finishes. Then all you have to do in the case of containerizing the application with Windows Admin Center is copy this zip file to your container host. That's it for the IIS portion. I'm going to come back in the container host and Windows Admin Center opened. Here we are now in a container host. This container host is actually running Windows Server 2019. It could be running a sac release of Windows Server that doesn't have any line, then it could open Windows Admin Center via Windows 10. There are many ways you can actually deploy Windows Admin Center and then connect to the container host that you want to deploy your container, or at least validate the container because at the end of the day, what we want to do here is, we want to run this application on Azure Community Services or AKS. Remember the zip file that we just exported from the old Windows Server 2012 R2 server. That's the file here. I just copied from that old server to this new one. Now what I'm going to do is I'm going to open Windows Admin Center. As you can see, I'm targeting this container host, which in my case is also the server that is actually running Windows Admin Center. Because this is a container host, the containers extension shows up. I can see the summary, the containers I have running, I have the images, networks, and volumes. I have many options for managing containers now through Windows Admin Center. We covered that in a previous video. Today I'm going to show you specifically for WebDeploy how can we actually take that zip file and run it in a container. To get started, as you can see, I selected the images tab. I have multiple images here. I can click to create new because that's what we want to do. I want to create a new container image based on that file that we exported. For now, as you know, we have only IIS web application. The future will be adding other options here. I also have what is the source of my application type. This is the important thing that we have to change now. Notice the Dockerfile preview that we have here in the bottom, it will change depending on what the configuration that I select. For example, if I have a static web application folder, this is a simple Dockerfile. If I have a ASP.NET solution file from Visual Studio, as soon as I select where is my source for the Visual Studio file, the Dockerfile preview will change here. In our case, what we have is, we have a web deploy exported zip file. I'm going to select this option. I'm going to select the location where the zip file resides. Once I do that, let's select the video folder. I'm going to select the file here and I click okay. As you can see, the Dockerfile changed dramatically now because at the end of the day now, we changed the type of application that we're deploying. Now, I have, for example, what is the base image that we'll be using for this. I have all the configuration that actually goes and deploy web deploy itself to IS, so we can go and actually restore the package. Basically, what I have to do here is, I have to select what is the framework version I want to use. In my case, I can use the 4.8, but if you have a really old application, you can even run the 3.5 in run all the way back there. In my case, 4.8 will work, so that's it. I can select, if I have any additional script, so if your application, when you deploy it, you require that, I don't know, you want to change the folders, you want to run whatever it is, and you have a PowerShell script to do that. You can select that here. So let's put a name to this. I'm going to call it ViniBeerWD just because it's from web deploy and then what is the tag I want to use? I'm going to call it V1, and let's just review the Docker file here. Looks fine, I don't want to make any manual changes, but I could if I wanted to. I'm going to click build, and I'm going to be back in a second because this process takes about a minute or two, and then I'm going to cut this from the video. All right, so as you can see, the container image was created successfully. I have the details here, but I can pretty much close this tab now. You can see that the image is here. I can click the image and see the details of the image that I just created. I can now actually validate that the application is running properly inside a container. Once I run a container based on this container image, I can directly from Windows Admin Center run a new container. So I'm going to click run. I don't have to specify a container name. Docker can do that for me. The only thing that I have to do in the options that you see here is actually provide a port. And the reason for that is because in my case, I'm actually using network address translation, which is a net network for Docker. And then what I'm going to do is I'm going to map a port, the port 8082 from the host to the port 80 of the container itself. So this is just so we can access the container and the application running inside of it through the container host. I'm going to click run. This should take just a few seconds and there you go. I have now a container instance running from this container image. I can go back to the containers tab. You can see that I have this container running here. I have the details of the container down here. So I can expand and see it's using this much memory. It's using this much network IO. And then the port 8082 is mapped. So in order to validate that application is running, let's go check in another tab. So I'm going to open local host port 8082 slash Vinny beer, which is the application that we actually imported. And this should open the application in just a second. There you go. The application continues to run. So just to validate, let's open that page that we showed before. It's running correctly. So let's select one here just to see if the application is running correctly, five gallons. As you can see the calculation here that the page does continues to run fine, which means that my application is running correctly. So basically just to recap what we did here, we had a Windows Server 2012 R2. We had IIS running on there. We have an application running on-premises on that server on IIS. And we exported the application using WebDeploy. From that, we generated a zip file, which is this one. And using Windows Admin Center in the images tab here on the containers extension, we have a nicer UI now to actually go and create new container images through multiple ways. One of the ways now that you can actually create a container image using Windows Admin Center is using a WebDeploy exported zip file. One of the things that is interesting here is remember the Docker file that I showed you when we were actually performing the process of creating the container image. Well, it's right here. You can actually reuse this Docker file if you need. You can integrate this with your DevOps pipeline and you can reuse this Docker file now for whatever you want. But the most important thing is actually that we have now a container running locally that actually have the same application that I had in a virtual machine. Now I have inside of a container. So that's it for the first video of this video series. I'll see you next week where we're going to look at how to get this container image that we created via Windows Admin Center and push it to a Azure Container Registry in Azure. And then just to check that the container continues to run in there, we are going to use Azure Container Instance. But our ultimate goal in this video series is to actually show you how to deploy this in Azure Kubernetes Services. So I'll see you next week. Thanks for watching and see you next time.