Azure Functions always logging in trace costing 50 USD for 12 hours in App Insight fees

Dan 11 Reputation points
2021-07-23T14:46:30.297+00:00
{
  "version": "2.0",
  "logging": {
    "fileLoggingMode": "never",
    "logLevel": {
      "default": "None"
    },
    "applicationInsights": {
      "samplingSettings": {
        "isEnabled": false,
        "excludedTypes": "Request"
      }
    }
  },
  "extensionBundle": {
    "id": "Microsoft.Azure.Functions.ExtensionBundle",
    "version": "[2.*, 3.0.0)"
  },
  "extensions": {
    "http": {
      "routePrefix": ""
    }
  }
}

This hosts.json still spams App Insights with TRACE level logs such as:

Request successfully matched the route with name 'FooBar' and temaplate '/foobar'
Host lock lease acquired by instance ID '000000000000000000000000A45F81BF'.
Executed 'Functions.FooBar' (Succeeded,...-2e3b-43cd-8e25-02c6fb974707, Duration=7ms)
Posting invocation id:f1ec9d88-2e3b-43cd-8...rkerId:698e2cd8-1c16-4aac-b3b1-4874ceb4c660
Sending invocation id:f1ec9d88-2e3b-43cd-8e25-02c6fb974707

Those logs accumulate to GBs worth of trash that's very very very expensive - 50 USD in 12hours expensive for literally no use.

On average 5 entries per HTTP Request are being sent to App Insight that's a huge fanout-cost...

Is there a way to monitor Function Execution Count without App Insight? It seems borderline insane to spend this much for the most basic metric you can think of

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

1 answer

Sort by: Most helpful
  1. Pramod Valavala 20,626 Reputation points Microsoft Employee
    2021-07-28T07:36:17.167+00:00

    @Dan Looks like you've disabled sampling settings which controls the number of logs sent out to Application Insights. The default is true but you've set applicationInsights.samplingSettings.isEnabled to false.

    As for the ExecutionCount metric, since that is recorded in Azure Monitor, it should not have any correlation to AzureWebJobsDashboard.


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.