We have an Azure Website setup with a "staging" deployment slot, and we use a continuous Azure WebJob to process long-running background jobs. It appears that when you publish to the Website (and include the WebJob binaries), that the WebJob will restart itself if it was previously stopped.
Our current deployment process looks like the following:
- Deploy to STAGING
- Immediately & Quickly stop the WebJob on STAGING (try to prevent 2 WebJobs from processing messages)
- Smoke test and verify code on STAGING works
- Stop the PRODUCTION WebJob (let it drain off queue messages)
- Swap between PRODUCTION and STAGING
- Start the PRODUCTION WebJob (which was just the STAGING WebJob)
Is there a trick (say a flag file or something) to tell a WebJob NOT to start up after publishing?