New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Internal WebJob Scheduler: settings.job vs. webjobs-publish-settings.json #1601
Comments
The best place to start with scheduler issues is by going to the scheduler log at https://sloader.scm.azurewebsites.net/vfs/data/jobs/triggered/Sloader-Sample-WebJobHost/job_scheduler.log Your schedule consist of 5 fields and it should be 6 so this is probably the issue. The |
Ah, ok... the issue was the wrong syntax. So, the webjob_.json files are only for the build and the VS tooling, but the internal scheduler will just consume the settings.job file, right? The content of thethe webjob_.json files are not important for the scheduler and it doesn't matter if the runMode is on "ondemand" or anything else, correct? |
Ah, I found the source for the "wrong" cron expression. I followed the link in your blogpost to this side, which has only 5 components https://code.google.com/p/ncrontab/wiki/CrontabExamples Edit: NCron seems to be not very compatible with other cron expression implementations |
Mh... I used this expression in my settings.job file: And I see this in my log: What does expected in mean? My goal was to get the webjob running once per hour. Is the next run scheduled to a specific time (01:51.41 pm/am?) or in around 2 hours? Besides the syntax issue: This feature is awesome - just change some values in the GitHub repo and maybe you found the correct syntax ;) |
Important to know: |
Correct, the feature requires the site to be in Standard mode. Closing this as it seems all issues have been figured out. |
I tried to use the new internal WebJob Scheduler for my side project. I deleted the old webjob and the old scheduler via the Azure Portal. My scenario is simple: Building a small worker, that runs every hour. I use GitHub and I didn't want to use heavy tooling to change the schedule. It would be awesome if I could just change something in the github repo and the schedule is changed - so the new internal webjob scheduler seems perfect.
I added a new settings.job file to my console app. I edited the corresponding webjobs-list.json published it to GitHub which should hopefully trigger the Website/Webjob deployment. But it failed with a MSBuild Error "The target ResolveWebJobFiles does not exist in the project". I added the WebJobs-Publishing NuGet package, but this didn't resolve the error. I needed to add the webjob-publish-settings.json file like this (Code-Inside/Sloader@f6a0e66).
Here is the first question: Do I really need this file and if yes which "runMode" should I use for the internal scheduler? The scheduled runMode seems wrong, because I configure the scheduling now via the "settings.job" file. Or is this currently only needed because of an issue with your internal build scripts and this file must be in the project, otherwise "ResolveWebJobFiles" will fail?
So, with the "OnDemand" webjob-publish-settings.json, the correct webjobs-list.json and the settings.job the Website and the WebJob deployment was ok.
But it seems, that my webjob is not triggered:
[{"latest_run":null,"history_url":"https://sloader.scm.azurewebsites.net/api/triggeredwebjobs/Sloader-Sample-WebJobHost/history","scheduler_logs_url":"https://sloader.scm.azurewebsites.net/vfs/data/jobs/triggered/Sloader-Sample-WebJobHost/job_scheduler.log","name":"Sloader-Sample-WebJobHost","run_command":"Sloader.Sample.WebJobHost.exe","url":"https://sloader.scm.azurewebsites.net/api/triggeredwebjobs/Sloader-Sample-WebJobHost","extra_info_url":"https://sloader.scm.azurewebsites.net/azurejobs/#/jobs/triggered/Sloader-Sample-WebJobHost","type":"triggered","error":null,"using_sdk":false,"settings":{"schedule":"5 * * * *"}}]
The main question is: It seems that my webjob is not running as expected. Is my NCron Syntax wrong or do I miss something?
The actual WebJob:
https://github.com/Code-Inside/Sloader/tree/master/src/Sloader.Sample.WebJobHost
The hosting Website:
https://github.com/Code-Inside/Sloader/tree/master/src/Sloader.Web
I created this gist with all important settings files:
https://gist.github.com/robertmuehsig/a925d5ea4d76f8a2b682
The text was updated successfully, but these errors were encountered: