27 Publishing and deploying your application

 

This chapter covers

  • Publishing an ASP.NET Core application
  • Hosting an ASP.NET Core application in IIS
  • Customizing the URLs for an ASP.NET Core app

We’ve covered a vast amount of ground so far in this book. We’ve gone over the basic mechanics of building an ASP.NET Core application, such as configuring dependency injection (DI), loading app settings, and building a middleware pipeline. We’ve looked at building APIs using minimal APIs and web API controllers. We’ve looked at the server-rendered UI side, using Razor templates and layouts to build an HTML response. And we’ve looked at higher-level abstractions, such as Entity Framework Core (EF Core) and ASP.NET Core Identity, that let you interact with a database and add users to your application. In this chapter we’re taking a slightly different route. Instead of looking at ways to build bigger and better applications, we’ll focus on what it means to deploy your application so that users can access it.

We’ll start by looking again at the ASP.NET Core hosting model in section 27.1 and examining why you might want to host your application behind a reverse proxy instead of exposing your app directly to the internet. I show you the difference between running an ASP.NET Core app in development using dotnet run and publishing the app for use on a remote server. Finally, I describe some of the options available when you’re deciding how and where to deploy your app.

27.1 Understanding the ASP.NET Core hosting model

27.1.1 Running vs. publishing an ASP.NET Core app

27.1.2 Choosing a deployment method for your application

27.2 Publishing your app to IIS

27.2.1 Configuring IIS for ASP.NET Core

27.2.2 Preparing and publishing your application to IIS

27.3 Hosting an application in Linux

27.3.1 Running an ASP.NET Core app behind a reverse proxy in Linux

27.3.2 Preparing your app for deployment to Linux

27.4 Configuring the URLs for your application

Summary