在交换期间防止登台站点重新启动 [英] Preventing staging site restart during a swap

查看:19
本文介绍了在交换期间防止登台站点重新启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据我了解,临时站点需要重新启动的唯一原因是是否存在配置为插槽设置的应用设置或连接字符串.

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).

还有哪些其他因素可以决定临时站点是否会在交换期间重新启动?

(我在 kudu GitHub 存储库,但尚未收到回复)

(I posted this on the kudu GitHub repository, but haven't heard back)

回应拜伦的回答:

我已经做了一些非常彻底的测试(请参阅 我的测试回购)和我能够执行插槽交换(有和没有预览)无需重新启动生产或暂存插槽.这显然是在 Web 应用程序上没有配置插槽设置.

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.

这篇关于在交换期间防止登台站点重新启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆