Hosting an ASP.NET Core application on IIS works a little differently compared to previous versions of ASP.NET. In this video, learn how to install the necessary tools and configure IIS to act as a reverse proxy to Kestrel, the ASP.NET Core web server. By the end of the video, IIS will be ready to host an ASP.NET Core application.
- [Instructor] Earlier I discussed how an ASP.NET Core application is hosted. Let's dive a little bit deeper into how this works specifically with IIS. In a Window's environment IIS acts as a reverse proxy that forwards requests to Kestrel, which is hosting your ASP.NET Core application. The ASP.NET Core module, or ANCM provides this functionality as a plugin inside of IIS. It's important to note that IIS and the ASP.NET Core Module don't support HTTP.S, they only support Kestrel. If you're using HTTP.S as your web server on a Window's environment, you'll need to either use it as a edge server or put it behind a different reverse proxy.
Before deploying an ASP.NET Core application to IIS you need to do a little bit of configuration on your server machine. Of course, if IIS is not already installed, you need to install that first. And then you need to install the .NET Core Window's server hosting bundle. This package includes the .NET Core runtime as well as the ASP.NET Core module for IIS. Finally, one you've installed the bundle, then you need to restart the machine, or just IIS. I'll demonstrate how to set IIS on Window's 10. If you have Window's server, the steps will look a little different but the concept is the same.
I'll start here by right clicking on Start and choosing Apps & features. Then I'll do Program & features so that I can get to Turn Window's features on or off. What I'm looking for in this list is internet information services, or IIS. And I also want to make sure that the IIS management console is turned on. When I click okay Windows will install these additional components and then we can close these windows and install the hosting bundle. I downloaded the hosting bundle from Microsoft's website already, so this should just be a couple of clicks to install the hosting bundle; and that's it.
After you install the bundle, go ahead and restart the machine or just run IIS reset in an administrator command prompt to restart IIS. Now the server is ready to host an ASP.NET Core application. Next, I'll show you how to create the site in app pool configuration in IIS for the application.
- Setting up your ASP.NET project
- Choosing a deployment strategy
- Configuring HTTPS and forwarding
- Deploying to IIS
- Deploying to Azure
- Deploying to Linux
- Deploying with Docker