0
votes

I am running a triggered web job - runs on every 15 minutes - it is a console application which moves data from SQL Server to Mongo Database. I have configured the WEBJOBS_IDLE_TIMEOUT and SCM_COMMAND_IDLE_TIMEOUT values to 3600. It was in an idle state for the last 5 days and it didn't abort or timed out. I had to restart the web app to abort the web job and restart it.

Azure WebJob Dashboard

Is there a way I can configure the web job should abort after a specific time period?

1

1 Answers

1
votes

The WEBJOBS_IDLE_TIMEOUT configuration only applies if your webjob has no CPU and no IO activity (see WebJobs in the Kudu wiki)

CPU activity is measured via Process.TotalProcessorTime while IO activity is measured via inspecting the standard and error output streams of your webjob for new characters. Source: IdleManager.WaitForExit and Executable.ExecuteInternal.

If possible, let your webjob exit gracefully after it's done its job. If you want to forcefully abort a long running operation that is still consuming CPU or IO, you'll have to code this in your webjob directly.