user310988
user310988

Reputation:

How do I include the app.settings file when publishing (from Visual Studio) an Azure WebJob?

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.

Upvotes: 16

Views: 7401

Answers (2)

Andrew Maisey
Andrew Maisey

Reputation: 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.

Upvotes: -1

David Ebbo
David Ebbo

Reputation: 43203

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.

Upvotes: 18

Related Questions