0

I have 2 Azure web jobs. One is triggered and other one is Continuous. Whenever there is some change in server configuration or app configuration of the web job, Triggered web job goes into aborted state. It goes because because of the change, application need to be restarted and somehow it is not able to restart properly. Need help on this

Levi Lu-MSFT
  • 27,483
  • 2
  • 31
  • 43

1 Answers1

0

Here is the source code of setting the status:

if (triggeredJobStatus.Status == JobStatus.Running)
            {
                if (isLatest)
                {
                    // If it is the latest run, make sure it's actually running
                    string triggeredJobDataPath = Path.Combine(JobsDataPath, jobName);
                    LockFile triggeredJobRunLockFile = TriggeredJobRunner.BuildTriggeredJobRunnerLockFile(triggeredJobDataPath, TraceFactory);
                    if (!triggeredJobRunLockFile.IsHeld)
                    {
                        triggeredJobStatus.Status = JobStatus.Aborted;
                    }
                }
                else
                {
                    // If it's not latest run it cannot be running
                    triggeredJobStatus.Status = JobStatus.Aborted;
                }
            }

Additionally have you checked the logs for the WebJob and all of its triggered methods? Please read through the logs and check if anything abnormal is going on.

Job status is shown as aborted if its status file shows it as running, but it is not actually running.

Additional Reference:

https://github.com/MicrosoftDocs/azure-docs/issues/19686

Hope it helps.

Mohit Verma
  • 5,140
  • 2
  • 12
  • 27
  • Thanks @mohit But is not failing when job is triggered. It is failing when I change the configuration and because of that it restart. when it restart, it is not able to initialize and it goes into aborted state. Unfortunately there is no log for that. – Pankaj Jain Dec 19 '19 at 09:12