Best practise: restart after deployment?
# help-with-umbraco
d
Hi Everyone, We are deploying our Umbraco 13 website to Microsoft Azure (as a App Service on Linux) which works perfectly well right now. But, i am wondering if i should restart the application after the deployment. I heard some people say this would be wise because of some rare caching issues, but is this still the case for Umbraco 13? I'd rather not restart the application as this takes time (i know i could tackle this with deployment slots). We do use uSync and Azure Blob Storage. What are your toughts on this topic?
d
Hi there! I personally haven't heard of anything like this. In my experience, Umbraco applications work fine after a deployment, no reboot required
k
I didn't think it was possible to not restart the application during deployment. You are replacing the actual application executable when you deploy. Perhaps the application starts too soon after deployment, before all files are deployed? We use the app_offline Azure (or is it IIS? We use Windows app services) deployment mechanism to delay the start until the release pipe has finished.
s
Yeah this is what I've found, on Linux, you can just overwrite the dlls, even if they're "in use".. pretty smooth! I do think it reboots the site though, at least for me. So.. your mileage may vary. If it works (can easily test it by making sure there's a new codepath that will produce a new result) then good for you. The one thing that doesn't refresh if you don't reboot the site: config values. Most of them will not be picked up until you do an actual reboot. One more thing that concerns me: if you site takes long to boot then make sure to investigate what's going on.
k
Check the Umbraco logs for obvious startup bottlenecks. Sometimes uSync configuration and/or the number of uSync files can cause uSync to take a while, but it reports to the log.
I can't imagine when you wouldn't want new code to be in use after a deployment. All other assets would be out of sync with code then, even razor unless in precompiled mode.
s
Of course you'd want it to be used. But if the app doesn't reboot, I doubt it would actually be in use, so I'd check a new codepath to make sure you're not looking at the old version. I suspect this might be the case (the old version still being active) since AFAIK, without recycling the site you wouldn't be able to switch to the new version.
d
Thanks for your answers folks! Good to hear a restart is not necessary, unless some appsettings changes are done (which we are aware of). I did some testing and my changes were visible after every release. I also spoke to one of our devs who claimed that the restart is necessary but that appears to be some specific ViteJS scenario.
j
How are you doing the deployment @Domitnator ?
d
@Jason We use Azure Devops. One multi stage yaml pipeline for creating all the azure resources (via Bicep templates) and one for building and deploying the Umbraco 13 app.
j
I was thinking more about what protocol etc. Depending on how you deploy it might get restarted anyway as part of the deployment. Surely there will need to be a restart to load the new DLLs (and anything else that's only loaded at boot like certain config). It's safest to always take the app offline during deployment and start it again when done in any case.
101 Views