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

1

7

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?

Unclothe answered 3/4, 2019 at 20:39 Comment(5)
How are you deploying regular ASP.NET? Xcopy? Or Web Deploy?Anestassia
@Anestassia that's partly what I'm trying to figure out. Do either of those affect the answer?Unclothe
I'm asking how you're deploying your existing application. I'm not aware of some built in way of deploying an ASP.NET application without an outage.Anestassia
@Anestassia with ASP.NET we use MSDeploy and it works great. The old App domain stays around while the new one spins up. It's not 100% seamless due to application start time but there are no dropped requests.Unclothe
Don't think so, we host our asp.net core apps on windows in iis and had to use the app_offline.htm approach to be able to just xcopy the application.Danialah
E
5

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.

Evaginate answered 3/4, 2019 at 20:44 Comment(1)
Does Azure continuous deployment work with Asp.net Core? In .Net MVC, this can be accomplished to an Azure App Service. Then you simply point the continuous deployment tool at your production or test git branch.Talkative

© 2022 - 2024 — McMap. All rights reserved.