Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Will an Azure Web job run on multiple instances?

I am planning to deploy a website to Azure, that will utilize Web Jobs.

If the site is scaled up to run on multiple instances, should I expect the job to be started on all the instances as well (running concurrently), or can I expect there to only be one instance of the job running at a time ? Can this be configured in Azure ?

like image 703
driis Avatar asked Feb 11 '14 19:02

driis


1 Answers

I assume you are using Continuous WebJobs and not Manual/Scheduled. In that case, it will run on all the instances at once. For this to happen correctly, you need to be running in Standard mode, and have the Always On setting enabled.

If you don't want it to run on all instances, you can set it to be in 'singleton' mode by creating a file called settings.job alongside your WebJob files. It should contain:

{ "is_singleton": true }

Note that when using the Kudu Process Explorer UI, you are connecting to a single instance, and won't see processes from other instances. Instead, use the Processes UI built in the Preview Portal (https://portal.azure.com/), which shows processes in all instances.

like image 60
David Ebbo Avatar answered Nov 02 '22 17:11

David Ebbo