Azure OnDemand WebJob status changed to Aborted - azure

I'm working with Azure WebJobs, converting my task schedulers to WebJobs (my task scheduler is an .exe) When I run the WebJob OnDemand, after it runs for 4 to 5 hours its status is changing to Aborted and my data is not updated in my database. When I Googled this, I found one potential solution regarding Graceful Shutdown here:
The graceful period can be updated for any WebJob, the way to do
it is to create a file called settings.job with the following content:
{ "stopping_wait_time": 60 }
I've tried this, adding the property "stopping_wait_time": 1800 to my settings.job file and put the file in my site at app_Data/jobs/myjobname/myjobname/settings.job
However, this hasn't helped me. Can anyone help? Thanks in advance.

Related

Azure Recovery services scheduled tasks keep going disabled

I have installed Azure Recovery Services (MARS) onto a 2019 server. I can fully configure it using the GUI, but the scheduled backups just don't run.
I can run the back manually and it runs perfectly and completes quickly; however, when I try to use the scheduler, it doesn't run.
I have checked the Task Scheduler and the job keeps switching to disabled with the notification:
User "System" disabled Task Scheduler task "\Microsoft\OnlineBackup\Microsoft-OnlineBackup"
When I installed the application, I changed the default path to C:\Domain Services to keep them separate, is this where it went wrong?
I have other servers on the backup platform which are not having any issues at all, I have also tried the steps in:
https://learn.microsoft.com/en-us/azure/backup/backup-azure-mars-troubleshoot#backups-dont-run-according-to-schedule
And also
https://dirteam.com/bas/2019/01/09/the-mysterious-case-of-azure-backup-agent-not-running-its-schedule/
But it is not fixing the issue.
I am completely out of ideas, hoping that somebody can help me!
Change the settings in the task scheduler for Online Backups. See the snippet below.
I have no idea how, but the system is now working correctly and not being disabled. I tried to remove all the MARS software on the machine and re-installed it and it now works correctly and has been backing up for a few weeks now.
Thank you for all your assistance.

Azure WebJob never ran. Why?

Navigating to App Services in Azure, then navigating to WebJobs, I am able to add a new WebJob. I name it, upload a zip file with the necessary files, and under type, I select triggered instead of continuous. For Triggers, scheduled is selected.
For the CRON expression, I put 0 */5 * * * *. Sure enough, this WebJob runs every 5 minutes. I can check my WebJob Logs to see their status and that they're returned "successful".
However, when attempting to do the same process but with a different CRON expression, the WebJob never ran.
Yesterday, I uploaded the same exact zip file as above, but with 0 0 5 * * * as the CRON Expression (Set to run at 5AM every morning).
I checked this morning in my Microsoft Azure WebJobs Logs and under "Last Run Time", the WebJob says Never ran.
Why is this?
Will the WebJob not run if I'm not logged into Azure to make sure it runs? How can I guarantee this WebJob to be run?
Anyone else having this problem?
All times are UTC as already mentioned here by someone else. If you have something against UTC, you can alter the timezone by setting WEBSITE_TIME_ZONE application setting as detailed here.
Also make sure you have Always On enabled for the site that hosts the Webjob, otherwise the w3wp.exe process that is in charge of the crontab won't be around to kick off your job.
Azure Portal → Your Web App → Application Settings → Always On
For completness's sake, Kudu uses a 6-field cron expression. The 1st field represents seconds rather than minutes (which is the first field in classic crontab).
More here: https://github.com/projectkudu/kudu/wiki/Web-jobs#scheduling-a-triggered-webjob

Azure web job stops running

I have a PowerShell script that runs every 5 minutes via the Web Job functionality of a Web App.
Along with the Powershell script I have a settings.job with the following config, which is what makes it tick rather than configuring it as part of the Web job setup:
{
"schedule": "0 */5 * * * *"
}
The job runs successfully each 5 mins for a few hours, but i notice each morning that is has stopped. I'm thinking maybe as a result of an IIS Recycle (?) the job is stopping and then I have to manually kick it off again.
How do I keep it always running?
From the documentation under "Create a scheduled WebJob using a CRON expression":
This technique is available to Web Apps running in Basic, Standard or Premium mode, and requires the Always On setting to be enabled on the app.
Can you check whether your Web App is using Always On?
You might try Azure Automation it can run PowerShell scripts and can be kicked off via a Schedule

Azure deployment: Error while creating webjob schedule (400 Bad Request)

I receive the following error while publishing and Azure Website from Visual Studio 2013:
12>Publish Succeeded. 12>Creating the scheduler job
12>C:\projectPath\packages\Microsoft.Web.WebJobs.Publish.1.0.7\tools\webjobs.console.targets(110,5):
Error : An error occurred while creating the WebJob schedule: Response
status code does not indicate success: 400 (Bad Request).
I have read another posts with similar issues: 404 error, BadRequest: The condition specified by the ETag is not satisfied... but none of these seem to be the problem here. I have reinstalled the Microsoft Azure Tools for VS 2013, the webjobs.publish package in my solution and it didn't work either. I also checked this post https://social.msdn.microsoft.com/forums/azure/en-US/d5b44e53-c4d7-48ff-a024-4bdd6eb48b79/sheduled-web-jobs-in-azure-web-site-not-configurable-in-same-region-as-web-siteand-workaround?forum=azurescheduler#d5b44e53-c4d7-48ff-a024-4bdd6eb48b79 and did what he tried but it haven't solved the issue.
It looks like all my files are uploaded correctly to the Azure website, and the issue begins when the scheduler jobs are being created.
The strange thing is that the webjobs are uploaded (updated) and that they are also working correctly, but the scheduled webjobs are not in my jobcollection list in the Azure management portal. I also tried to remove my current job collection and all the jobs from my website, but when I publish the site, all the webjobs are created but the job collection is empty.
I had a similar issue with VS and the problemas was that the credentials of the website were expired, but the problem was solved by reentering the credentials in VS. Any idea of how to solve this issue?
Please see my answer to Visual Studio 2015 Publish WebJobs Issue, which shows an alternate way to do scheduling that makes things far simpler and avoids this type of conditions.
To summarize, you can create a settings.job file at the root of your WebJob file, containing a CRON expression. e.g.
{
"schedule": "0 0 * * * *"
}
For more information, about this technique, see the following documentation links:
https://azure.microsoft.com/en-us/documentation/articles/web-sites-create-web-jobs/#CreateScheduledCRON
http://blog.amitapple.com/post/2015/06/scheduling-azure-webjobs/
I faced the same issue today and the solution for me was simpler. What happened is that the startTime I had configured on my webjob-publish-settings.json was for some days ago (while I was developing). I changed the startTime for tomorrow and it worked. Looks like the scheduler is not able to get started when the startTime is not in the future. Hope it helps.
As I have noted in my question, I deleted my webcolletion to solve the issue, but I did not notice that the new collection was created in free mode (I do not know why because my site is in standard mode). So setting the jobcollection to standard mode partially solved the problem. Then I got the following error:
An error occurred while creating the WebJob schedule: Response status
code does not indicate success: 409 (Conflict).
I went to the azure portal, and I saw that all jobs but one were created correctly (as scheduled jobs). I reset the webjob-publish-settings.json file of the webjob, I published it and the problem was solved.

how long does it take to create an Azure Cloud Service? How to view log information?

I'm brand new to Azure. I'm trying to get a Cloud Service running with 3 web roles.
Last night I created the .cspkg and .cscfg files, exported the certificates and uploaded everything to Azure manager. The manager said my Cloud Service was successful, however for the last 10 hours when I click on "Cloud Services" in the manager it shows my service, but it says "Creating" with wait gif under "SERVICE STATUS".
Is it really still creating? Or did it fail? Is it possible to view more detailed information about the creation process and/or any log files?
Thanks,
Something "bad" has happened. Service Spin up time should be at most a few minutes.
I've seen it take up to 10-15 minutes depending on the hosting center and the number of scaled instances that need to come up but 10 hrs something has definitely gone wrong.
I would delete the service and start again. If you experience the same problem, have a look in your service start up code and make sure that there's no exceptions/infinite loops, other problems in there that might be causing problems.
It may miss any assembly references. If you included any assembly references(packages that are not part of .net) then please ensure that its copy to local attribute is set to true.

Resources