In this section, we'll add logging to your Azure Functions using Azure Application Insights. We'll need to receive vital information about what our software is doing, so that we can triage issues. And to ensure that it happens correctly, we'll need the Azure Functions created earlier. Let's begin by implementing the following steps:
- Create an Application Insights instance by going on to the portal and creating one from the marketplace. Use the .NET app setting. Note down the instrumentation key from the overview panel; you'll need it later.
- Install a NuGet package, Microsoft.ApplicationInsights.
- Add the line of code in the screenshot (the private static string with the application insights key in it) ...