With Azure WebApps I know I can make a WebJob a singleton by adding the "is_singleton": true
to the WebJob settings.job
file, and this works great if I have for example, 3 instances in a single WebApp deployment.
However - how can I publish to two WebApps (use case, two different regions) and make the WebJob run as a singleton and only on one of the deployments.
Example of desired behavior:
Sydney Deployment
- My Singleton Webjob (Running)
- My other WebJobs that process a queue (Running)
Singapore Deployment
- My Singleton Webjob (Not running, or perhaps not even deployed?)
- My other WebJobs that process a queue (Running)
I know I can log in to the azure portal and disable the web job in one of the deployments, but is there a transform or change I can make to my publish profiles in visual studio to achieve the desired behavior automatically?
I'm currently deploying with Visual Studio 2015.