WebJob - <project_name> is not recognized as an internal or external command

Jordi Dalmau 20 Reputation points
2023-06-04T15:10:06.1433333+00:00

I uploaded a WebJob project with a name that contains whitespaces (for example "WebJobs.My project") to my Azure Web application, and at the time of running it I got the following error logs:

[06/04/2023 14:51:35 > 92ca53: SYS INFO] Status changed to Initializing [06/04/2023 14:51:35 > 92ca53: SYS INFO] Run script 'run.cmd' with script host - 'WindowsScriptHost' [06/04/2023 14:51:35 > 92ca53: SYS INFO] Status changed to Running [06/04/2023 14:51:36 > 92ca53: INFO] [06/04/2023 14:51:36 > 92ca53: INFO] C:\local\Temp\jobs\triggered\WebJobs.My project\dudvpc3a.l4y>WebJobs.My project.exe
[06/04/2023 14:51:36 > 92ca53: ERR ] 'WebJobs.My' is not recognized as an internal or external command, [06/04/2023 14:51:36 > 92ca53: ERR ] operable program or batch file. [06/04/2023 14:51:36 > 92ca53: SYS INFO] Status changed to Failed [06/04/2023 14:51:36 > 92ca53: SYS ERR ] Job failed due to exit code 1

Looks like the typical issue that happens when you forget to enclose a file path with quotes in CMD. I guess a possible solution would be removing any whitespaces from my project name, but it would break my project naming convention...

Any suggestions?

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,373 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,877 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Ryan Hill 25,666 Reputation points Microsoft Employee
    2023-06-08T21:01:10.7966667+00:00

    Hi @Jordi Dalmau

    You can create a run.bat or run.cmd that encapsulates your app with the whitespace. Include this file with the deployment as the platform will check for this file first before looking for an exe.

    You can read more about this on WebJobs · projectkudu/kudu Wiki (github.com)

    0 comments No comments