Deploy Blazor Server Side app without stopping site

Viewed 485

What is the recommend strategy to deploy a Blazor server SPA on a windows server machine with IIS without having a (even very short) downtime?

When I do some changes, I publish the project on local folder but then I have to manually stop the site on the server, else the copy hangs due file access lock.

Thanks

2 Answers

In my opinion, if you want to achieve zero downtime publish the new site, the only way is using two server.

You should use two servers and IIS load balance. You could firstly modify the load balance to transfer all the request to the second server and then publish the application to the first server.

After you tested the first server and make sure the first server is working well. Then you could transfer all the request to first server.

More details about how to use IIS loadbalance, you could refer to this article.

At the end, I created a .bat that before copying to production server rename a App_offline.xxx file in App_offline.htm, copy the files and then do the vice versa renaming. Some seconds of downtime (with a message "server updating, refresh in few seconds...") much better that manual stop the site and then restart.

Related