Triggered Azure Web Job goes into Aborted State

126 Views Asked by At

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

1

There are 1 best solutions below

1
On

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.