This is an issue that will soon be fixed, for now as a workaround move IncidentPoll.exe
to be in the root of your WebJobs directory (if you're using a zip to upload your WebJob, make sure the zip has this binary at the root).
Azure WebJobs ConsoleApp error
-
22-06-2023 - |
سؤال
I experimented with WebJobs over the weekend, and my console app worked fine - until today. It started failing with this error message on the log page:
[03/26/2014 19:21:30 > 8fa263: SYS INFO] Status changed to Initializing
[03/26/2014 19:21:31 > 8fa263: SYS INFO] Run script 'IncidentPoll.exe' with script host - 'WindowsScriptHost'
[03/26/2014 19:21:31 > 8fa263: SYS INFO] Status changed to Running
[03/26/2014 19:21:31 > 8fa263: ERR ] 'IncidentPoll.exe' is not recognized as an internal or external command,
[03/26/2014 19:21:31 > 8fa263: ERR ] operable program or batch file.
[03/26/2014 19:21:31 > 8fa263: SYS INFO] Status changed to Failed
[03/26/2014 19:21:31 > 8fa263: SYS ERR ] Job failed due to exit code 1
I didn't change anything this morning. So I'm wondering if there's a policy change that occurred since last weekend?
EDIT: This webjob, is under the Websites Free tier. It was scheduled to fire every 10 minutes. Could it be because they (Microsoft) found this as a loophole? They also have a (dedicated) Scheduler Service (preview), in which under the Free tier, the maximum frequency that you can run is once per hour.
المحلول 2
نصائح أخرى
I was met with a very similar issue when running the executable from run.cmd
. So I fired up the Kudu debug console and manually invoked run.cmd
. The result was the following:
'Foo.exe' is not recognized as an internal or external command, operable program or batch file.
It was pretty clear now that the culprit was that strange 
prefix. A quick web search turned up UTF-8 without BOM which demystified the issue - Visual Studio was adding a UTF BOM header that was confusing the Kudu (Azure) shell.
Fortunately the thread also contained a simple fix. In Visual Studio: File -> Advanced Save Options -> Encoding -> Unicode (UTF-8 without signature).