question

Dan-7159 avatar image
0 Votes"
Dan-7159 asked Dan-7159 commented

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

 {
   "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
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

After a lot of looking around and testing random stuff I found that https://docs.microsoft.com/en-us/azure/azure-functions/functions-app-settings#azurewebjobsdashboard is full of lies.

The option AzureWebJobsDashboard IS valid for v2 and above functions and further more it's not Optional unless you don't care about the most basic metrics such as ExecutionCount.

In Conclusion; Trash App Insight because it's extremely expensive for literally no use other than being spammed with Azure Internal Traces that nobody needs, Enable AzureWebJobsDashboard and save 100 bucks per day on an almost idle API.

I'm baffled how Azure bills by ExecutionCount and yet makes it so difficult to see the actual metric (i.e. if you dont explicitly set that option, you wont even see the usage you're billed by!)

I got an Azure Function for 12 USD with literally 0 Execution Counts in it's monitoring tab over the whole existence... Massive Design Fail.

0 Votes 0 ·

1 Answer

PramodValavala-MSFT avatar image
0 Votes"
PramodValavala-MSFT answered Dan-7159 commented

@Dan-7159 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.


· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@PramodValavala-MSFT I will try with sampling set to something small.

Unfortunately AzureWebJobsDashboard is very much required to get Azure Monitor to work eventho it's not documented and even called deprecated for v2 functions.

Try it yourself. create an azure function and do not set the AzureWebJobsDashboard key or if the UI sets it then remove it - you will see that absolutely no metrics are recorded then and you're effectively flying blind but still being billed

0 Votes 0 ·
 {
   "version": "2.0",
   "logging": {
     "logLevel": {
       "default": "Information"
     },
     "applicationInsights": {
       "samplingSettings": {
         "isEnabled": true,
         "maxTelemetryItemsPerSecond" : 1,
         "excludedTypes": "Exception"
       }
     }
   },
   "extensionBundle": {
     "id": "Microsoft.Azure.Functions.ExtensionBundle",
     "version": "[2.*, 3.0.0)"
   },
   "extensions": {
     "http": {
       "routePrefix": ""
     }
   }
 }

This still generates a huge amount of Trace level messages. Just as before, 5 messages per 1 HTTP Request. So in this case this will eat up 50USD in 12hrs again just by idling

0 Votes 0 ·