20 Dec 2015 | Azure
I've come to realize that things can get a bit tricky when working with slot deployments and webjobs. I learned the hard way that stopping a slotted Web App does not stop the web jobs it hosts. This means that I can't just stop all my website slots and expect the related jobs to automatically shutdown as well. Bummer.
Okay, so I am thinking maybe I'll just disable the individual jobs for each of the slots? Not much luck on that front either as the Azure portal only provides a stop
option for continuous
jobs and not for the recurring
and OnDemand
jobs.
This limits us to a few possible solutions:
Baking-in custom disabling logic right into your job - For example, a web job could skip its operation based on a custom appsetting value. Once again, this appsetting would be defined as a slot setting.
A word of caution - be weary when implementing the "skipping" logic on continous jobs as "skipping" can be considered a successful run which would in turn pop the last message in the tiggered queue.
The nuke option - entirely delete the web job entries in each of the slots (not recommended).