Azure WebJobs and Deployment Slots

匆匆过客 提交于 2019-11-29 16:33:02

问题


What will happen when I deploy a continuously running Azure WebJob with a QueueTrigger (queue connection defined in app.config) into a Deployment Slot (for example "Staging")?

Will it start to run and listen to messages in the queue or will only start in the Production slot?

My fear is that if will just start processing messages from the queue even tough its not in the Production slot yet. If this is the case, should the queue connectionstring be moved from app.config into Azure Website config so my Staging and Production slots can run on different queues?


回答1:


Yes, it will start running in the staging slot.

If you don't want this, then pointing it to a staging queue is indeed the way to go.

Update (11/24/2014): you can now chose to make certain setting & connection strings 'sticky to the slot' using PowerShell. See this post for details.




回答2:


Using slot sticky settings, you can now set

WEBJOBS_STOPPED = 1

on the staging slot. This will prevent webjobs from starting on the staging slot, and the setting will remain on the staging slot when the code is swapped into production.

https://github.com/projectkudu/kudu/wiki/Web-jobs#configuration-settings



来源:https://stackoverflow.com/questions/24438789/azure-webjobs-and-deployment-slots

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!