Search code examples
c#.netazurecommand-linewebjob

How does Azure WebJob's 'Run Command' gets set?


I am trying to deploy multiple WebJobs. The WebJobs are tied on a WebApp. Recently, I have noticed that the 'Run Command' on the WebJobs are different than the expected ones. So if the WebJob name is 'CopyFileWebJob', the Run Command for this WebJob should ideally be 'CopyFileJobWebJob.exe', but instead its a different 'exe' file that we added as a dependent package from NuGet. Please note that in order to deploy the WebJobs, we just publish the WebApp and that takes care of deploying all the WebJobs tied to it.

I am checking the 'Run Command' from WebJobs's log page which is available on the new Azure portal.

Is there a way to manually set what command the Azure WebJob should invoke? Thank you.


Solution

  • The URL of the WebJob is correct, I did double check that. As we started looking more into this, we came across this article: https://github.com/projectkudu/kudu/wiki/WebJobs

    In the section where they have described the logic they use to decide which file the script should run within the job's director, they have mentioned that "Webjobs looks for "run.*", and if it can't find one, it looks for any valid extension in alphabetical order.".

    So, we renamed the 'Assembly Name' for the WebJob project to 'Run' and that caused the WebJob to compile into Run.exe and after we published it, the Run Command was set to 'Run.exe'.