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
Asked
Active
Viewed 105 times
0

Levi Lu-MSFT
- 27,483
- 2
- 31
- 43
-
Do you enable the Always on? – George Chen Dec 18 '19 at 08:32
-
@GeorgeChen it is enabled – Pankaj Jain Dec 18 '19 at 08:54
-
It happens when there is any not handled exception thrown. Could you please post the logs of aborted web job? – Ajay Dec 18 '19 at 13:25
-
I do not see any logs when it is getting aborted.In my Triggered Job, I do not have any place where exception handling is not done. But when configuration is changed, it is getting failed. At that time anyways Web Job will not be triggered. – Pankaj Jain Dec 19 '19 at 09:10
1 Answers
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