问题描述
据我了解,登台站点需要重新启动的唯一原因是是否存在配置为插槽设置的应用程序设置或连接字符串.
From how I understand it, the only reason a staging site would require restart is if there exists app settings or connection strings configured as slot settings.
尽管这并不总是正确的.无论如何,我们的应用程序之一将重新启动.我已经使用Powershell cmdlet来确保门户中没有隐藏"插槽设置(因为这显然是一件事情).
Although this doesn't always seem to be true. One of our applications will restart regardless. I have used Powershell cmdlets to be sure that there are no slot settings "hidden" from the Portal (because apparently this is a thing).
还有哪些其他因素可以确定是否在交换期间重新启动登台站点?
(我在此 .com/projectkudu/kudu"rel =" noreferrer> kudu GitHub存储库,但未收到回复)
(I posted this on the kudu GitHub repository, but haven't heard back)
对拜伦的回答:
我已经完成了一些相当彻底的测试(为此请参见我的测试仓库),并且我可以执行插槽交换(带有和不带有预览),而无需重启生产或暂存插槽..显然,这是在Web Apps上未配置的广告位设置.
I have done some pretty thorough testing (see my testing repo for this) and I am able to perform slot swapping (with and without Preview) without either production or staging slot restarting. This is obviously with no slot settings configured on the Web Apps.
这是否意味着不能保证重新启动?我在这里提出的问题是,如果不重新启动,IIS的应用程序初始化模块仍将确保应用程序确实已预热(因为这些事情可能要花费几分钟)?
Does this mean that restarts are not guaranteed? The issue I'm raising here is that if no restart occurs will IIS' Application Initialisation module still ensure that the application has indeed warmed up (as these things could take a couple of minutes)?
推荐答案
如果对应用程序设置或连接字符串标记为插槽设置,则交换插槽将始终在交换之前重新启动.还有其他一些条件会导致重新启动,例如,如此处所述启用连续部署时 http://ruslany.net/2014/03/azure-web-sites-continuous-deployment-with-staged-publishing/.重新启动的其他原因是在生产或暂存插槽上启用了站点身份验证的情况.
You are right that the staging slot will always be restarted prior to the swap if there are app settings or connection strings marked as slot settings. There are a few other conditions that cause restart, for example when continuous deployment is enabled as described here http://ruslany.net/2014/03/azure-web-sites-continuous-deployment-with-staged-publishing/. Other reason for restart is when site authentication is enabled on either production or the staging slots.
如果没有重新启动,则在交换期间将不会重新执行appinit模块,因为它仅在初始化工作进程时运行.如果要确保始终重启,则可以创建一些虚拟应用程序设置并将其标记为广告位设置.
If there is no restart then appinit module will not be re-executed during the swap because it only runs when the worker process is initialized. If you want to ensure that there is always restart then you can just create some dummy app setting and mark it as a slot setting.
这篇关于防止交换期间暂存站点重新启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!