Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure WebJobs and Deployment Slots

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?

like image 669
pbering Avatar asked Jun 26 '14 19:06

pbering


People also ask

What are Azure deployment slots?

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.

What is the difference between Azure functions and WebJobs?

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.

How many deployment slots are available in app Services Azure?

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.

How do you deploy Azure WebJobs?

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.


1 Answers

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

like image 98
Erik A. Brandstadmoen Avatar answered Oct 04 '22 16:10

Erik A. Brandstadmoen