16

I have a continuous WebJob that I would like to configure to only ever have a single instance.

This is achieved by putting the " { enableLogs: 1 } " setting in the app.settings file.

What I'm struggling with is the deployment of such a file.

That seems lame...

The same article does suggest using the WebJobs API, but again this isn't built in to the Publish process, so it'd be a manual step or some odd code that runs in the WebJob itself.

I feel I must be missing a way to get this working with the Publish process.

I've had a search around on Google looking for people who have done the same thing but I'm not finding much.

2 Answers2

18

Please try the following:

  • In VS, add the settings.job file at the root of your WebJobs console app
  • Under the file's properties, mark it as Copy if newer (or Copy always)

And it should get deployed. Find full sample that does that here: https://github.com/davidebbo-test/WebAppWithWebJobsVS.

David Ebbo
  • 42,443
  • 8
  • 103
  • 117
  • Ahhh yes, of course ... heh I feel rather silly for having to ask now. Thank you! –  Oct 22 '15 at 08:14
-1

I added the settings.job into my respective bin folders for each web job + "Copy Always" setting - then did an Azure Publish from Visual Studio. Worked a charm.

Needed to restart my Azure App for this to pick up.

  • Don't ever put files into bin folders manually. It will bite you back. Put the file along with your other code, and use copy always (as you said). – Jim Aho Nov 23 '18 at 09:21