Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to smoothly "hot deploy" an ASP.NET Core app?

Under ASP.NET with .NET Framework, you can perform a "hot deploy" of new code without disruption. This works because IIS can juggle multiple app domains for the same application: when new code arrives it "drain stops" the old app domain, allowing it to finish requests while simultaneously the new app domain starts up and starts serving new requests.

My question is: is there any parallel to this in ASP.NET Core with Kestrel? If so, what?

like image 764
ChaseMedallion Avatar asked Apr 03 '19 20:04

ChaseMedallion


People also ask

How to deploy an ASP NET Core app to a hosting environment?

In general, to deploy an ASP.NET Core app to a hosting environment: Deploy the published app to a folder on the hosting server. Set up a process manager that starts the app when requests arrive and restarts the app after it crashes or the server reboots. For configuration of a reverse proxy, set up a reverse proxy to forward requests to the app.

What is ASP NET Core?

ASP.NET Core is a free, open source, and cross-platform web development framework provided by Microsoft. It is not an upgraded version of ASP.NET but it is a completely rewritten framework from scratch which comes with a single programming model for ASP.NET MVC and ASP.NET Web API. Here, I am not going to discuss ASP.NET Core and its features.

Should I use IIs with ASP NET Core hosting?

Advantages of Using IIS with ASP.NET Core Hosting. Microsoft recommends using IIS with any public facing site for ASP.NET core hosting. IIS provides additional levels of configurability, management, security, logging, and many other things.

What is the default route for a new ASP NET Core app?

In this case, a new ASP.NET Core app is created and hosted in IIS as a separate web application within the existing ASP.NET MVC web site. Since it will be added as a child of the original web site and will be named api, its default route should no longer begin with api/.


1 Answers

Kestrel doesn't have this built in like IIS does. Think about it: Kestrel binds directly to port 80. You have to start a new Kestrel process to update your code. Those processes can't share port 80 and there is no way to hand it off from one process to the other without a reverse proxy in front of both.

You could use a load balancer in front of your webservers. Then do a rolling update or a blue-green deployment.

like image 121
Greg Avatar answered Oct 06 '22 16:10

Greg