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 ?
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.
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