0
votes

In Visual Studio, I am deploying a web site to Azure via the Publish menu option, and the project has an existing web job added to it (via the Add menu). It was added as a continuous job, and has the correct entries in the 'webjob-publish-settings.json' and 'webjobs-list.json' files.

When I publish the web site, the job is compiled and put into place in the 'jobs' folder and published with the web site. However, it is not started. No entry is added automatically to the WebJobs settings page in Azure, which remains empty. There are no errors in the output window.

The Azure webjobs documentation states that it will attempt to run a selection of files from within the webjob directory, and one of these is any file that ends with ".exe". The webjob project is a console project, and compiles into an exe which is published in the directory.

In the past, I have published this job by zipping the contents of the 'bin\Release' directory, and adding it manually.

How can I debug why it does not start when deployed automatically?

3

3 Answers

1
votes

First thing you should do is look at exactly what got deployed, to make sure it looks like what you expect. To do this:

  • Go to Kudu Console
  • Go to D:\home\site\wwwroot\App_Data\jobs\continuous
  • You should see a folder named after your WebJob in there. Go in that folder
  • Check that it has all the right files

If it doesn't, then you likely have some kind of deployment issue, and it is not an issue with the WebJobs runtime.

0
votes

I think when you published the Web site, it just copied over the Webjob files but Azure does not know that there's a Webjob that has been published. Could you please try publishing the WebJob separately by selecting "Publish as Webjob" option. If it has problems publishing that way then there's some problem in your Webjob, like app settings etc, and if it is successfully published then I guess you have to publish it separately every time or find a hack in Publish settings of the Website to publish both the projects.

Hope it helps. Thanks

0
votes

I had a web job that was working fine, I stopped it, changed a value in the config file and started it again. It didn't start, no errors, no log issues, nothing at all.

How I fixed it? I clicked "Restart" button in the app service that contains all the web jobs.

Note: stop and start did not work, only "Restart" did the trick. It really makes no sense but that's what happened. I hope it helps others with the same issue.