user457485
user457485

Reputation: 307

Does Azure Webjob stop when Azure App Service is stopped

In our current setup there are 2 slots for an Azure App service, the question that I have is, when the slot is stopped would it also shut down the webjob that is deployed on that slot or would the web job continue to run?

Upvotes: 16

Views: 4626

Answers (2)

IKriKan
IKriKan

Reputation: 1157

https://github.com/projectkudu/kudu/wiki/Full-stopping-a-Web-App

I have actually deleted some running jobs, but even though my jobs were shown as deleted in the UI, they are silently running and consuming the memory. I observed this from availability and Performance > Memory Analysis dashboard under Memory Drill Down > Memory Usage (App) > Physical Memory Usage section. Shocked to see the jobs still running after they are deleted. Luckily this solution helped me kill all the processes.

Upvotes: 0

Aram
Aram

Reputation: 5705

It is possible to run an Azure WebJob even when the Azure App Service Web App is not running.

Though you can force the WebJob not to run or stop when the Web App is running using WEBJOBS_STOPPED setting in your Web App's "Application Settings"

Take a look at this article about this subject for more details:

https://blogs.msdn.microsoft.com/benjaminperkins/2017/03/01/failed-to-run-webjob/

The following picture shows a running WebJob when the web app is not running:

enter image description here

Upvotes: 13

Related Questions