Monitoring Azure Functions
Monitoring Azure Functions is important if you want to know whether there are any errors that are raised by the application during testing.
In this recipe, you will learn how to view the logs that are written to Application Insights by Azure Functions' code. As a developer, this knowledge can help troubleshoot any exceptions that may occur during application development.
Let's make a small change to the HTTP trigger function and then run it a few times with the test data.
How to do it…
In this recipe, we'll learn how to review the application traces using Application Insight's Logs. Let's perform the following steps:
- Navigate to the HTTP trigger that we created and replace the following code. I have moved the line of code that logs the information to the Logs console and added the
name
parameter at the end of the method:public static async Task<IActionResult> Run(HttpRequest req, ILogger log) ...