Linux App Service continuous WebJob stuck in “Disabling” after Stop: kuduagent never moves to “Stopping” or creates WEBJOBS_SHUTDOWN_FILE

Ben O'Donovan 0 Reputation points
2026-10-22T12:39:16.81+00:00

Environment

  • App Service on Linux, single instance, Always On enabled
  • Stack DOTNETCORE|10.0; WEBSITE_RUN_FROM_PACKAGE is not set; WEBSITE_SKIP_RUNNING_KUDUAGENT=False
  • One continuous WebJob, .NET 10, WebJobs SDK 3.0.47, run_command: run.sh (SDK-generated, runs dotnet run.dll)
  • Production + staging slot; WEBJOBS_STOPPED=1 is a sticky slot setting on staging only

What happened

  1. The job had been running normally for ~6 days ("WebJob is still running" heartbeat every 12h in job_log.txt).
  2. I clicked Stop in the portal. job_log.txt logged Status changed to Disabling, and then nothing else, ever.
  3. I then published a new build of the WebJob from Visual Studio (Publish → Azure WebJobs). Nothing was logged for that either: no "Detected WebJob file/s were updated", no restart. The old process kept running from its /tmp/jobs/continuous/<job>/<random> copy.
  4. GET /api/continuouswebjobs/<job> kept returning status: "Disabling", detailed_status: "<instance> - Disabling", error: null until I intervened manually.

Evidence that the shutdown signal was never sent

  • The job process environment has WEBJOBS_SHUTDOWN_FILE=/tmp/JobsShutdown/continuous/<job>/<random>.ony.
  • Over SSH into the app container, that directory was empty, with a last-modified time equal to when the job started 6 days earlier. So the shutdown file was never created, even briefly.
  • ps showed the job (dotnet run.dll, child of bash run.sh, child of kuduagent.dll) alive and idle in state SNl. It was not hung in I/O and not a zombie. No "Stopping" or "Process went down" entry was ever logged.
  • After the Visual Studio publish there was no disable.job in the job folder (the publish replaced the folder contents).

This is not the read-only folder / run-from-package issue I've seen Unable to stop the continuous webJob deployed from Azure-DevOps, where Stop fails because disable.job can't be written to a read-only wwwroot. That doesn't apply here:

  • WEBSITE_RUN_FROM_PACKAGE is not set. The site is deployed with OneDeploy (extracted, not mounted), and the WebJob ships inside the site package at App_Data/jobs/continuous/<job>/.
  • The job folder is writable: the later Visual Studio publish replaced files in that same folder.
  • In KuduLite, DisableJob() writes disable.job via OperationManager.Attempt (which rethrows if every retry fails) before reporting "Disabling". Getting "Disabling" with error: null means the write succeeded. The failure is in what should happen next: the watcher event that calls StopJob.
Azure App Service
Azure App Service

Azure App Service is a service used to create and deploy scalable, mission-critical web apps.

0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.