When I swap deployment slots in Azure, do the web jobs restart? If so, do they restart with the destination configuration or source configuration values?
In my case, I don't want the web jobs to run in the staging slot. To deal with this, I have the following code:
public static void Main()
{
// Only run web jobs when configured
bool enableWebJobs = false;
bool.TryParse(ConfigurationManager.AppSettings["EnableWebJobs"], out enableWebJobs);
if (enableWebJobs)
{
var host = new JobHost();
host.RunAndBlock();
}
else
{
// Sleep so the Azure web jobs platform doesn't try to continually restart the process
while (true)
{
Thread.Sleep(60000);
}
}
}
I'm just unsure if the web jobs will be restarted after the swap with the correct AppSettings. If not, then this won't work at all as EnableWebJobs will remain false.