DEV Community

Discussion on: Develop Azure Functions using .NET Core 3.1

Collapse
 
abmismi profile image
abmis-mi

Hi,
I want to add app insights logging to Azure Function v3 as we do in Web Jobs v3 like:
builder.ConfigureLogging((context, logging) =>
{
logging.AddApplicationInsightsWebJobs(o => o.InstrumentationKey = appInsightsKey);
});

I tried similar code there but it didn't work.
builder.Services.AddLogging(builder => {
builder.AddApplicationInsights(appInsightsKey);
});

Is there a documented way of adding app insights to azure functions in code?