Advice on Setting Up Application Insights for Function Apps

DJ 50 Reputation points
2025-03-17T10:31:52.47+00:00

Hi,

We need some advice on how to set up Application Insights for our Function Apps. I noticed that all Application Insights for the Function Apps are connected to the same Log Analytics workspace. Should it be set up this way?

Additionally, each of our Function Apps serves a different purpose. One Function App is triggered when a message is received by our IoT Hub. The Application Insight for the IoT Hub needs to be disabled, as we do not need to store device sensor data from the IoT Hub. This would generate an excessive amount of unnecessary data and impact our budget unnecessarily. How can this be disabled?

Lastly, can we configure Application Insights to send email notifications for any exceptions or errors that occur, providing alerts instead of having to log in to the portal?

Best regards,

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,909 questions
{count} votes

Accepted answer
  1. Khadeer Ali 5,990 Reputation points Microsoft External Staff Moderator
    2025-03-19T14:13:39.9633333+00:00

    @DJ ,

    Based on our discussion, I have outlined the optimal setup for Application Insights in your Function Apps while ensuring cost efficiency and capturing only relevant logs.

    1. Log Analytics Workspace Structure

    You do not require separate billing, regional compliance, or environment-specific requirements. Since Function Apps have minimal retention needs, a single Log Analytics workspace is sufficient to manage all Application Insights telemetry.

    1. Restricting Logs Sent to Application Insights

    To control what gets logged, modify the host.json configuration in your Function App:

    json
    {
      "logging": {
        "applicationInsights": {
          "samplingSettings": {
            "isEnabled": true,
            "includeTypes": "Exception",
            "excludeTypes": "Request, Trace, Dependency, Event"
          }
        }
      }
    }
    

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.