Hello Anoop Suryadevara
Welcome to the Microsoft Q&A and thank you for posting your questions here.
I understand that you are facing challenges on the configuration or initialization of the ApplicationInsightsLoggerOptions.
To configure Application Insights for a WebJob using a connection string instead of an instrumentation key, you need to ensure that you set up the Application Insights SDK correctly and use the connection string in the configuration.
Three major areas to look into are:
- Setting Connection String and format - https://docs.microsoft.com/azure/azure-monitor/app/sdk-connection-string
- Configuring Application Insights appropriately - https://docs.microsoft.com/aspnet/core/fundamentals/diagnostics/application-insights?view=aspnetcore-7.0 and WebJobs Integration - https://docs.microsoft.com/azure/azure-functions/functions-bindings-appinsights (This might have multiple links, check appropriate that related with your issue).
- Also, adding Required NuGet Packages - https://www.nuget.org/packages/Microsoft.ApplicationInsights/ and https://www.nuget.org/packages/Microsoft.Extensions.Logging.ApplicationInsights/
Accept Answer
I hope this is helpful! Do not hesitate to let me know if you have any other questions.
** Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful ** so that others in the community facing similar issues can easily find the solution.
Best Regards,
Sina Salam