---
title: "Azure API Management + Nodinite: Reduce Logging Costs and TCO"
description: What does logging Azure API Management traffic to Nodinite cost in Azure? Honest examples by API volume and payload size for Blob Storage and Event Hub, the APIM-specific cost drivers, and how to cut duplicate Application Insights and Log Analytics costs.
---

# <i class="fal fa-cloud-arrow-down" aria-hidden="true"></i> Azure API Management + Nodinite: Reduce Logging Costs and TCO

Logging Azure API Management (APIM) traffic to <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> isn't free in Azure. The [Blob Storage Policy][] and [Event Hub Policy][] stage every request and response in your subscription before the [Pickup Service][] moves them to <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span>, and Azure bills for that staging and for the network traffic. At the same time, many APIM environments already pay to log the same calls to **Application Insights** and **Log Analytics**.

This page shows what the <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> logging adds to your Azure bill, with examples by API volume and payload size, and where you can save by not storing the same payloads twice. The general Blob Storage and Event Hub cost model, shared with [Serilog][] and Logic Apps, is on [Azure Costs for Blob Storage and Event Hub][]; this page covers what is specific to APIM.

In short: <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> can reduce your Azure logging costs when it replaces duplicate ingestion and long-term retention of complete API request and response payloads in Application Insights and Log Analytics. Your actual savings depend on your workload, payload sizes, retention, Azure pricing agreement and region, network topology, and on the <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> license and SQL Server costs, which the examples below don't include.

<aside aria-label="Note" class="nodinite-note nodinite-note--note">
<p class="nodinite-note__label" aria-hidden="true"><i class="far fa-fw fa-note"></i> Note</p>
<div class="nodinite-note__content"><p>All prices are <strong>illustrative list prices (USD, pay-as-you-go, a US region)</strong>, not quotes, and the tables compare <strong>Azure costs only</strong>. Prices differ by region and change over time. Use the <a href="https://azure.microsoft.com/en-us/pricing/calculator/">Azure pricing calculator</a><sup><i class="fal fa-arrow-up-right-from-square" aria-hidden="true"></i></sup> with your own volumes, region, and agreement.</p></div>
</aside>

## <i class="fal fa-sitemap" aria-hidden="true"></i> Understanding the architecture difference

Without a plan, the same API call is often stored in three places, each with its own price per GB:

<div class="mermaid">
graph LR
    APIM["fa:fa-cloud Azure API Management"] --> AI["fa:fa-chart-line Application Insights<br/>request telemetry + bodies"]
    APIM --> LA["fa:fa-table Log Analytics<br/>gateway resource logs"]
    APIM --> STG["fa:fa-boxes-stacked Blob Storage or Event Hub"]
    STG --> NOD["fa:fa-database Nodinite<br/>payloads, long-term history"]
    style APIM fill:#2678BD
    style AI fill:#E47528
    style LA fill:#E47528
    style STG fill:#3F827B
    style NOD fill:#93d16d
</div>

*Diagram: Three logging paths from one APIM instance. Orange paths bill per GB ingested and retained; green is the <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> path, billed per operation or throughput, with long-term storage on your own <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> databases.*

The cost-saving idea is the same as for [Logic Apps run history][Reduce Azure Logic Apps Run History Retention to Lower TCO]: **let each tool do what it's best at, and store payloads once**. Application Insights and Log Analytics remain useful for performance and platform troubleshooting, but they don't need to keep request and response bodies if <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> does.

## <i class="fal fa-puzzle-piece" aria-hidden="true"></i> What APIM logging to Nodinite adds

|Cost driver|What happens|Effect on cost|
|---|---|---|
|<i class="fal fa-copy" aria-hidden="true"></i> **Two [Log Events][] per API call**|The inbound fragment logs the request and the outbound fragment logs the response; the on-error fragment adds a third on failures|Double the number of Blob operations or Event Hub events compared with API calls|
|<i class="fal fa-file-code" aria-hidden="true"></i> **Base64-encoded bodies**|The policies base64-encode the body, which adds about one third to the size, plus headers as context properties|More bytes in Event Hub throughput and over the network|
|<i class="fal fa-weight-hanging" aria-hidden="true"></i> **Event Hub 200 KB limit**|APIM's `log-to-eventhub` drops events over 200 KB; after base64 this means bodies of roughly 145 KB or less|Larger bodies need the [Blob Storage Policy][]|
|<i class="fal fa-receipt" aria-hidden="true"></i> **No extra billed API calls**|On the Consumption tier, APIM bills per incoming API call. The outbound `send-request` (Blob Storage) and `log-to-eventhub` (Event Hub) calls made by the logging policies aren't billed as API calls|No APIM cost per logged call on Consumption; the cost is in the staging resource|
|<i class="fal fa-gauge" aria-hidden="true"></i> **Gateway capacity**|Reading bodies with `preserveContent` and encoding them uses gateway memory and CPU|On the classic and v2 tiers, at high throughput with large bodies, watch the **Capacity** metric before you add units|
|<i class="fal fa-network-wired" aria-hidden="true"></i> **Network restrictions**|Microsoft is retiring trusted service connectivity, which affects private Blob and Event Hub access from APIM|Some alternatives require a higher APIM tier or private endpoints; see [Network Restrictions & Alternative Solutions][]|

## <i class="fal fa-calculator" aria-hidden="true"></i> Illustrative cost examples

Some teams log API traffic to Azure Monitor instead of <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span>, for example through the APIM Application Insights diagnostic settings, the `trace` policy, or a policy that sends records to Log Analytics through Event Hub or the Logs Ingestion API. The examples below price the **same calls and the same payloads** for each option, so you can compare them in one table. Workspace-based Application Insights stores its data in Log Analytics, so the Log Analytics rows cover it too.

### Assumptions

* <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> options: two Log Events per API call (request and response), each sized payload × 4/3 (base64) + 2 KB of headers and context
* Blob Storage: Hot, LRS, soft delete off, no versioning or malware scanning. Each Log Event costs one write, one read, and its share of list operations, and the Pickup Service deletes the blob after pickup, so stored capacity stays near zero. Other storage settings or transaction patterns change these figures
* Event Hub: Standard, 1-day retention. Throughput units (TUs) are sized for four times the average ingress, with at least 1 TU: TUs = max(1, ⌈4 × average MB/s⌉), where one TU accepts 1 MB/s or 1,000 events/s. Each TU costs about $0.03 an hour, plus $0.028 per million ingress events
* egress: internet list price, first 100 GB a month free, then $0.087/GB up to 10 TB, $0.083/GB for the next 40 TB, $0.07/GB for the next 100 TB, and $0.05/GB above that. It applies to both <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> options and to the full staged volume in the next table: request and response bodies, base64, and context. It is $0 when the Pickup Service runs in the same Azure region; between Azure regions the lower inter-region transfer price applies instead
* Log Analytics options: raw payload, 2 × (payload + 1 KB of telemetry) per API call, first 5 GB free each month
* **Log Analytics, 31-day retention**: Analytics table plan at the **pay-as-you-go** price of $2.30/GB, within the included retention. No commitment-tier discount is applied, so at high volume these rows are an **upper bound** (see the caveats below)
* **Log Analytics, 1-year retention**: the same, plus interactive retention at $0.10/GB per month for months 2 to 12. Once you've kept data for a full year, you pay retention on 11 months of data every month
* **Log Analytics Basic, 1-year long-term retention**: Basic table plan at $0.50/GB plus long-term retention at $0.02/GB per month (see the caveats below)

### Monthly data volume

|API calls/month|2 KB payload|10 KB payload|50 KB payload|140 KB payload|1 MB payload|
|---:|---:|---:|---:|---:|---:|
|**1 million**|~9 GB|~31 GB|~137 GB|~377 GB|~2.7 TB|
|**10 million**|~93 GB|~307 GB|~1.4 TB|~3.8 TB|~27 TB|
|**100 million**|~933 GB|~3.1 TB|~13.7 TB|~37.7 TB|~273 TB|

*Volume sent to <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> staging, including base64. The Log Analytics options ingest about a quarter less, because they store raw text.*

### Yearly Azure cost by option

Every figure is the **Azure cost for a full year** at the monthly call volume in the first column: 12 monthly bills, once retention is full (from the second year on). In the first year, the 1-year retention rows are lower, typically by 15–20%, because the stored history is still building up.

|API calls/month|Option|2 KB payload|10 KB payload|50 KB payload|140 KB payload|1 MB payload|
|---|---|---:|---:|---:|---:|---:|
|**1 million**|<span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> via Blob Storage|~$130|~$130|~$130|~$130|~$130|
|**1 million**|<span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> via Event Hub|~$260|~$260|~$260|~$260|Not possible|
|**1 million**|+ egress if <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> is outside the Azure region|$0|$0|~$40|~$290|~$2.7k|
|**1 million**|Log Analytics, 31-day retention|~$30|~$470|~$2.7k|~$7.6k|~$56k|
|**1 million**|Log Analytics, 1-year retention|~$110|~$760|~$4k|~$11k|~$84k|
|**1 million**|Log Analytics Basic, 1-year long-term retention|~$20|~$170|~$850|~$2.4k|~$18k|
|**10 million**|<span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> via Blob Storage|~$1.3k|~$1.3k|~$1.3k|~$1.3k|~$1.3k|
|**10 million**|<span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> via Event Hub|~$260|~$260|~$800|~$1.6k|Not possible|
|**10 million**|+ egress if <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> is outside the Azure region|$0|~$220|~$1.3k|~$3.8k|~$28k|
|**10 million**|Log Analytics, 31-day retention|~$1.5k|~$5.9k|~$28k|~$78k|~$566k|
|**10 million**|Log Analytics, 1-year retention|~$2.3k|~$8.8k|~$42k|~$115k|~$836k|
|**10 million**|Log Analytics Basic, 1-year long-term retention|~$490|~$1.9k|~$8.8k|~$24k|~$177k|
|**100 million**|<span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> via Blob Storage|~$13k|~$13k|~$13k|~$13k|~$13k|
|**100 million**|<span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> via Event Hub|~$590|~$1.4k|~$5.9k|Over Standard tier limit|Not possible|
|**100 million**|+ egress if <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> is outside the Azure region|~$860|~$3.1k|~$14k|~$38k|~$208k|
|**100 million**|Log Analytics, 31-day retention|~$16k|~$61k|~$281k|~$778k|~$5.7M|
|**100 million**|Log Analytics, 1-year retention|~$24k|~$90k|~$416k|~$1.15M|~$8.4M|
|**100 million**|Log Analytics Basic, 1-year long-term retention|~$5.2k|~$19k|~$88k|~$244k|~$1.8M|

### Reading the table

* **Retention is the big difference.** A Log Analytics workspace bills you in Azure for every GB, for every month you keep it, on top of the ingestion price. <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> only uses Azure as a short staging area: the Blob Storage and Event Hub rows stay the same whether you keep history for a month or ten years. The long-term history lives in your own SQL Server [Log Databases][], and [Message Types][] retention decides how long each kind of message is kept, for example invoices for 7 years and test messages for 30 days. You store only what matters, as long as it matters.
* **The Log Analytics rows grow with every GB.** Ingestion is paid once at $2.30/GB, and keeping data for 11 more months adds $1.10/GB. Matching long <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> retention, such as 7 years for invoices, would need Log Analytics long-term retention (up to 12 years) on every record of that type.
* **The <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> Azure cost follows events and throughput.** Blob Storage is priced per operation, so under the assumptions above it costs the same for any payload size. Event Hub is priced per throughput unit, which steps up with volume: at 10 million calls, both 2 KB and 10 KB payloads fit in the minimum of 1 TU, which is why those two figures are the same. The table below shows the TUs behind each Event Hub figure. At 100 million calls with 140 KB payloads, Event Hub needs about 59 TUs, more than the 40 a Standard namespace allows, so you'd need Premium, Dedicated, or several namespaces.
* **Network egress can be the largest <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> line item** for APIs with large payloads. Run the Pickup Service in the same Azure region as the staging resource to avoid it.

### Event Hub throughput units behind the figures

|API calls/month|2 KB payload|10 KB payload|50 KB payload|140 KB payload|
|---:|---:|---:|---:|---:|
|**1 million**|1 TU|1 TU|1 TU|1 TU|
|**10 million**|1 TU|1 TU|3 TUs|6 TUs|
|**100 million**|2 TUs|5 TUs|22 TUs|59 TUs|

*Two Log Events per call, spread evenly over a 30-day month, sized for four times the average. Bursty traffic needs more TUs, or auto-inflate, which raises the cost.*

For all the other meters and the settings that inflate the bill, such as blob soft delete, Defender for Storage malware scanning, and Event Hub auto-inflate, see [Hidden costs that are easy to miss][Azure Costs - Hidden costs].

### Payload limits in the Azure Monitor path

Azure Monitor isn't built for full message bodies:

* the APIM Application Insights diagnostic setting truncates each body at **8,192 bytes**
* Application Insights trace messages are limited to **32,768 characters**
* larger bodies must be split into several records and joined again when you query them

So, for payloads above about 8 KB, the Log Analytics rows assume a custom policy that splits bodies, which most teams don't build. <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> has no such limit with the [Blob Storage Policy][].

### Honest caveats

* **What the <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> rows leave out:** the fixed-price <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> license and the SQL Server storage for the [Log Databases][]. At the largest volumes that storage is significant: 100 million calls with 1 MB payloads is about 273 TB a month before [Message Types][] retention and filtering. The 1 MB column shows how each option scales; it isn't a typical setup.
* **Commitment tiers lower the Log Analytics price at volume.** From 100 GB a day, a commitment tier gives a lower per-GB price in exchange for a 31-day commitment. Most workspaces in the 10 million and 100 million rows would use one, so treat those Log Analytics figures as upper bounds and use the [pricing calculator](https://azure.microsoft.com/en-us/pricing/calculator/)<sup><i class="fal fa-arrow-up-right-from-square" aria-hidden="true"></i></sup> for your tier.
* **Very high volumes hit the ingestion rate limit.** A workspace accepts about 6 GB a minute from diagnostic settings by default. 100 million calls with 1 MB payloads averages close to 5 GB a minute, so peaks would be dropped unless Microsoft raises the limit through a support request.
* **The Basic table plan has trade-offs.** It limits queries and alerting, and charges per GB scanned when you query. Data in long-term retention must be restored, or searched with a search job, before you can query it.
* **Sampling lowers the Application Insights cost** because it drops calls. That's fine for performance telemetry, but it isn't a record of every request and response.

## <i class="fal fa-chart-line" aria-hidden="true"></i> Reduce duplicate Application Insights and Log Analytics costs

This is the APIM equivalent of reducing Logic Apps run-history retention. Both destinations bill per GB ingested (Log Analytics Analytics logs list at about $2.30/GB, with the first 5 GB per month free), and retention beyond the included 31 days costs extra.

### Application Insights

APIM's Application Insights integration can log request and response bodies, but **truncates them at 8,192 bytes**, so it can't replace <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> for full payloads anyway. In the APIM diagnostic settings for Application Insights (for all APIs or per API):

1. Set **Number of payload bytes to log** to `0` for the frontend and backend request and response when <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> logs the bodies.
2. Remove headers you don't need from the logged headers lists.
3. Lower the **Sampling** percentage for high-volume APIs; <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> still logs every call.
4. Consider a daily cap on the Application Insights resource as a safety net.

As an illustration, 10 million calls a month with about 2 KB of telemetry per call and no bodies is roughly 20 GB, or about $35 a month in ingestion. For what adding the bodies costs, see the Log Analytics rows in [Yearly Azure cost by option](#yearly-azure-cost-by-option).

### Log Analytics resource logs

APIM gateway logs (`ApiManagementGatewayLogs`) add one row per request. Keep them if your platform team uses them, but check:

* whether you need every log category in the diagnostic setting
* whether the table can use a lower-cost table plan for data that is rarely queried
* whether retention can stay at the included period, since <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> keeps the long-term history

## <i class="fal fa-filter" aria-hidden="true"></i> Log only what you need

Every skipped call saves two writes, two reads, and their bytes. Wrap the policy fragments in a condition to skip calls that don't need business logging, such as health probes:

```xml
<inbound>
    <choose>
        <when condition="@(!context.Request.Url.Path.EndsWith("/health"))">
            <include-fragment fragment-id="InboundLoggingPolicyFragment" />
        </when>
    </choose>
</inbound>
```

Use the same condition in the outbound section. Also remove headers you never search on from the logged context, and set [Message Types][] on each API so [Search Fields][] and retention policies apply to the events you keep.

## <i class="fal fa-diagram-project" aria-hidden="true"></i> Recommended architecture

### Azure API Management, Application Insights, and Log Analytics

* Performance, failures, and dependency telemetry, sampled and without bodies
* Platform troubleshooting with short retention

### Nodinite

* Every request and response with full payload, through the [Blob Storage Policy][] or [Event Hub Policy][]
* Long-term history in [Log Databases][], with [Message Types][] retention per business document
* [Search Fields][] on business identifiers, and [Log Views][] for teams without Azure Portal access

Application Insights and Log Analytics serve developers. <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> serves developers and the business: the same API calls are searchable by business data in role-based [Log Views][], next to your Logic Apps and Azure Functions traffic. Read why that matters in [Built for developers and the business][Azure Costs - Developers and Business].

## <i class="fal fa-hand-point-right" aria-hidden="true"></i> Next Steps

* <i class="fal fa-coins" aria-hidden="true"></i> [Azure Costs for Blob Storage and Event Hub][] — all meters and hidden costs  
* <i class="fal fa-cloud-arrow-down" aria-hidden="true"></i> [Blob Storage Policy][]  
* <i class="fal fa-cloud-arrow-down" aria-hidden="true"></i> [Event Hub Policy][]  

## <i class="fal fa-link-horizontal" aria-hidden="true"></i> Related Topics

* <i class="fal fa-coins" aria-hidden="true"></i> [Understand the Cost of Logging][Cost of Logging]  
* <i class="fal fa-cloud" aria-hidden="true"></i> [Azure API Management Logging][Azure API Management]  
* <i class="fal fa-wrench" aria-hidden="true"></i> [Troubleshooting Azure API Management][Troubleshooting]  
* <i class="fal fa-shield-halved" aria-hidden="true"></i> [Network Restrictions & Alternative Solutions][]  
* <i class="fal fa-clock" aria-hidden="true"></i> [Reduce Azure Logic Apps Run History Retention to Lower TCO][]  
* <i class="fal fa-bolt" aria-hidden="true"></i> [Reduce Azure Functions Logging Costs][]  
* <i class="fal fa-truck-pickup" aria-hidden="true"></i> [Pickup Service][]  
* <i class="fal fa-database" aria-hidden="true"></i> [Log Databases][]  
* <i class="fal fa-file" aria-hidden="true"></i> [Message Types][]  

[Azure API Management]:https://docs.nodinite.com/logging-and-monitoring/azure-api-management/overview/
[Azure Costs - Developers and Business]:https://docs.nodinite.com/logging-and-monitoring/custom-logging/troubleshooting/azure-costs-for-blob-storage-and-event-hub/#fa-users-built-for-developers-and-the-business
[Azure Costs - Hidden costs]:https://docs.nodinite.com/logging-and-monitoring/custom-logging/troubleshooting/azure-costs-for-blob-storage-and-event-hub/#fa-triangle-exclamation-hidden-costs-that-are-easy-to-miss
[Azure Costs for Blob Storage and Event Hub]:https://docs.nodinite.com/logging-and-monitoring/custom-logging/troubleshooting/azure-costs-for-blob-storage-and-event-hub/
[Blob Storage Policy]:https://docs.nodinite.com/logging-and-monitoring/azure-api-management/policy/blob-storage/
[Cost of Logging]:https://docs.nodinite.com/getting-started/log/logging-strategy/understand-the-cost-of-logging/
[Event Hub Policy]:https://docs.nodinite.com/logging-and-monitoring/azure-api-management/policy/event-hub/
[Log Databases]:https://docs.nodinite.com/core-services/log-databases/overview/
[Log Events]:https://docs.nodinite.com/core-services/log-event/overview/
[Log Views]:https://docs.nodinite.com/administration/log-management/log-views/features/what-is-a-log-view/
[Message Types]:https://docs.nodinite.com/repository-model/message-types/overview/
[Network Restrictions & Alternative Solutions]:https://docs.nodinite.com/logging-and-monitoring/azure-api-management/policy/network-restrictions/
[Pickup Service]:https://docs.nodinite.com/logging-and-monitoring/pickup-logevents-service/overview/
[Reduce Azure Functions Logging Costs]:https://docs.nodinite.com/logging-and-monitoring/serilog/troubleshooting/reduce-azure-functions-logging-costs/
[Reduce Azure Logic Apps Run History Retention to Lower TCO]:https://docs.nodinite.com/logging-and-monitoring/azure-logic-apps/troubleshooting/reduce-azure-logic-apps-run-history-retention-to-lower-tco/
[Search Fields]:https://docs.nodinite.com/administration/log-management/search-fields/features/what-is-a-search-field/
[Serilog]:https://docs.nodinite.com/logging-and-monitoring/serilog/overview/
[Troubleshooting]:https://docs.nodinite.com/logging-and-monitoring/azure-api-management/troubleshooting/overview/