- 4 minutes to read

Azure Functions + Nodinite: Reduce Logging Costs and TCO

Azure Functions send their logs to Application Insights by default, and many teams log message payloads there as well. Application Insights stores that data in a Log Analytics workspace, billed per GB ingested and per GB retained. When you also log the same payloads to Nodinite with the Serilog sinks, you pay for them twice.

In short: Nodinite can lower your Azure costs when it replaces payload logging and long retention in Application Insights. Your actual savings depend on your log volume, payload sizes, retention, Azure pricing, and on the Nodinite license and SQL Server costs. This page covers only what's specific to Azure Functions; the shared cost model is on Azure Costs for Blob Storage and Event Hub.

Understanding the two logging paths

graph LR FN["fa:fa-bolt Azure Function"] -->|Performance telemetry| AI["fa:fa-chart-line Application Insights
for developers"] FN -->|Business payloads via Serilog| NOD["fa:fa-database Nodinite
for developers and the business"] style FN fill:#2678BD style AI fill:#E47528 style NOD fill:#93d16d

Diagram: Keep Application Insights (orange) for performance telemetry, and log business payloads once to Nodinite (green).

Destination Best at Limits that matter for payloads
Application Insights Requests, dependencies, exceptions, performance, and live debugging for developers Trace messages are limited to 32,768 characters and telemetry items to 64 KB; Azure Functions sample telemetry by default, so it isn't a record of every message
Nodinite Every business message with its full payload, searchable by business data, with retention per Message Types Staging cost in Blob Storage or Event Hub; see Azure Costs for Blob Storage and Event Hub

Where the duplicate cost is

In Functions, payloads usually end up in Application Insights in one of these ways:

  • logger.LogInformation(...) calls that write the message body, which land in the traces table
  • a default log level of Information for all categories in host.json, so every user log is sent
  • longer retention on the workspace, to keep message history for audits

What these payloads cost per GB in Log Analytics, with and without long retention, is shown in the yearly cost table for API Management: the per-GB prices are the same for Functions.

Keep Application Insights lean

When Nodinite logs the business payloads, keep Application Insights for what it does best and stop sending payloads there:

  1. Log message bodies only through the Nodinite Serilog sink, not through the logger that feeds Application Insights. See How To Start Logging With Serilog and ILogger in Azure Functions.
  2. In host.json, set the default log level to Warning and keep Host.Results at Information, so you still get every function run in the requests table.
  3. Keep sampling enabled, and exclude Request and Exception from sampling so failures are never dropped.
  4. Keep the workspace retention at the included period; Nodinite keeps the long-term history.
{
  "version": "2.0",
  "logging": {
    "logLevel": {
      "default": "Warning",
      "Host.Results": "Information",
      "Host.Aggregator": "Information"
    },
    "applicationInsights": {
      "samplingSettings": {
        "isEnabled": true,
        "excludedTypes": "Request;Exception"
      }
    }
  }
}

Example: a lean Application Insights setup for Azure Functions. See Configure monitoring for Azure Functions for every option.

Tip

During a migration, Serilog can write to both destinations at the same time; see the Serilog FAQ. Remove the payloads from Application Insights once Nodinite has them.

Give the business access, not only developers

Application Insights is a developer tool: access goes through Azure RBAC, and searching means writing KQL. With role-based access in Nodinite, business users search the same Function messages by Order ID or Invoice Number in Log Views, limited by their Roles, and in the same view as your Logic Apps and API Management traffic. Read why this matters in Built for developers and the business.

Next Steps