问题
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