-
Notifications
You must be signed in to change notification settings - Fork 201
Open
Description
Hi,
Sorry for the new issue but I think this will bring a lot of open issues together to a final solution in a sample repository.
Hopefully we can make something default/officially/easier for new people because it took me a long time to figure everything out.
- This setup is ugly but solves AppInsights logging in Azure Functions v4 in combination with .NET 7. It uses the new (still in preview) Microsoft.Azure.Functions.Worker.ApplicationInsights package explained in PR 944
- It fixes the hardcoded Warning filter explained in 1123 comment. See auto added Warning filter details here.
- It highlights that the default Warning filter is automatically added explained here.
- It adds an
appsettings.json
configuration file for default configuration as suggested in Update samples and docs to add Host.CreateDefaultBuilder() #1025 - It loads the
appsettings.json
configuration file. - It configures the logging from out of the
appsettings.json
configuration file - It is a more realistic sample application other than "Hello world" because of multiple classes, loggers and injected loggers.
I want to thank @brettsam, @jviau and @kshyju for posting helpful comments that let me finally see some logging in Azure Application Insights lower than Warning (so Trace, Debug, Information).
See the sample repository for more details to get it running. See the details of the Func.Isolated.Net7.With.AI
project.
brandonh-msft, ErikEJ, lorenzograssi, p-m-j, dfaivre and 7 moreolandese, dferraro-mdsol, MO2k4, p-m-j, BadgerCode and 1 moreandagr, p-m-j, simonlrostron, itchy-squid and dstenroejltfisicaro