Azure-docs: Configure logging to use appsettings.json

Created on 19 Jun 2018  Â·  9Comments  Â·  Source: MicrosoftDocs/azure-docs

Most configuration is probably going to use appsettings.json. Your example does not explain how to do this. With .NET Core this is done automatically with this line: AddConfiguration((IConfiguration) hostingContext.Configuration.GetSection("Logging")); but there does not appear to be an "AddConfiguration" method for Web jobs.


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

app-service-wesvc assigned-to-author doc-enhancement triaged

All 9 comments

@grahambunce Thanks for the feedback! I have assigned the issue to the content author to investigate further and update the document as appropriate.

The DI changes just landed recently in the WebJobs SDK repo. You can see an example of the new host configuration pattern here: https://github.com/Azure/azure-webjobs-sdk/blob/dev/sample/SampleHost/Program.cs#L21.

@mathewc Thanks - any plans on when the next nuget beta package update will be that includes this?

@grahambunce we just published the packages with the new host/DI model to the MyGet feed here:
https://www.myget.org/F/azure-appservice/api/v3/index.json

You can install version 3.0.0-beta7-11363 from that feed to use the new features. We'd love to hear your feedback, so please let us know if you have any questions or problems.

@fabiocav Thanks for this. I presume the MyGet feed is intended for fast-track (internal?) development as opposed to the standard nuget feed which, even though it's a beta, is more stable. I'm unclear why the nuget feed is updated behind the MyGet feed and, as we're using the NuGet version extensively at the moment I'd like to understand the implications.

@fabiocav I got the QueueTrigger to work using the the new DI stuff referenced by @mathewc at

https://github.com/Azure/azure-webjobs-sdk/blob/dev/sample/SampleHost/Program.cs#L21.

But when trying to add TimerTrigger I get the following:

"No job functions found. Try making your job classes and methods public. If you're using binding extensions (e.g. ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. config.UseServiceBus(), config.UseTimers(), etc.)."

In the new configuration how do we register the "UseTimers()"?

Sample Repo. https://github.com/StevenTCramer/WebJobSdk3Sample

We're in the process of migrating extensions to the new DI registration model. That work isn't done yet.

@tdykstra do we have an internal work item to track this new WebJobs SDK behavior?

The updates are now live and we can #please-close this issue. Please reopen if we have not addressed your issue to your satisfaction.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mrdfuse picture mrdfuse  Â·  3Comments

JeffLoo-ong picture JeffLoo-ong  Â·  3Comments

behnam89 picture behnam89  Â·  3Comments

spottedmahn picture spottedmahn  Â·  3Comments

AronT-TLV picture AronT-TLV  Â·  3Comments