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?
Azure Functions deployment slots allow your function app to run different instances called "slots". Slots are different environments exposed via a publicly available endpoint. One app instance is always mapped to the production slot, and you can swap instances assigned to a slot on demand.
Summary. Azure Functions offers more developer productivity than Azure App Service WebJobs does. It also offers more options for programming languages, development environments, Azure service integration, and pricing. For most scenarios, it's the best choice.
The Standard tier supports up to 5 slots, but the Premium and Isolated tiers support up to 20. So if you're using the Standard tier, and for some reason, you need more than 5 slots, you can just scale up your service plan to the Premium tier. And that's it for deployment slots in Azure App Service.
Deploy to Azure App ServiceIn Solution Explorer, right-click the project and select Publish. In the Publish dialog box, select Azure for Target, and then select Next. Select Azure WebJobs for Specific target, and then select Next. Above App Service instances select the plus (+) button to Create a new Azure WebJob.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With