· ObjectSource GmbH · Tutorials · 4 min read
FinOps for Azure IoT - Reducing Azure Ingestion Costs by 60%
If you need to slash your Azure IoT Hub bill immediately, follow this 3-step FinOps framework.

If you need to slash your Azure IoT Hub bill immediately, follow this 3-step FinOps framework:
The Problem: Azure IoT Hub bills in 4KB “chunks.” Sending a tiny 100-byte ESP32 sensor reading wastes 97% of the paid message capacity.
The Solution: Edge-Side Batching & Compression.
Batching: Collect 20–40 sensor readings on the ESP32 and send them in a single JSON array once every 10–20 minutes.
Compression: Use Gzip compression on the ESP32 before sending to pack more data into a single 4KB chunk.
Tiering: Downgrade to the Basic Tier if you only need one-way telemetry, saving ~50% on unit costs compared to the Standard Tier.
The Benefit: By maximizing the 4KB meter size, you can reduce the number of billed messages by up to 90%, often allowing you to downscale your IoT Hub units significantly.
Introduction: The $10,000 “Small” Sensor
Meet Alex, a Cloud Architect for a logistics firm. He deployed 2,000 ESP32 sensors to track the temperature of refrigerated trucks. To get “high-resolution” data, he programmed the chips to send a reading every 30 seconds.
At the end of the month, Alex’s boss called him into the office with a printed invoice. The IoT Hub bill was nearly $12,000. Alex was stunned—the actual data payload for the entire month was less than 50GB.
What went wrong? Alex fell into the “4KB Chunk Trap.” Because he sent 170 million tiny messages, Azure billed him for 170 million 4KB chunks, even though his actual data was only bytes.
Alex spent a weekend refactoring the ESP32 firmware to batch the data. The next month, the bill dropped to $850. This wasn’t magic—it was FinOps. Here is how you can achieve the same results.
The FinOps Guide to Azure IoT
How exactly does Azure IoT Hub “meter” my data?
Think of it like a shipping container. Azure charges you for the container, not the weight inside. For paid tiers (S1, S2, B1, etc.), the “container” size is 4KB.
- If you send 10 bytes: 1 message billed.
- If you send 3.9 KB: 1 message billed.
- If you send 4.1 KB: 2 messages billed.
The goal for an Architect is to fill that 4KB container as close to the limit as possible before hitting “Send.”
My ESP32 is a low-memory device. How can I batch data?
You don’t need a massive buffer. For a simple temperature/AQI sensor, a single reading might be 100 bytes of JSON. You can store 40 readings in a simple C-style array (taking up only 4KB of RAM).
- Collect readings every minute.
- Store them in a JSON array:
[{"t":22, "h":50}, {"t":21, "h":51}, ...] - Transmit the array once every 40 minutes. Result: You just reduced your bill for that device by 97.5%.
Can I save money by switching from the Standard (S1) to Basic (B1) tier?
Yes. If your ESP32 sensors are “set and forget” and don’t require Cloud-to-Device commands or Device Twins, the Basic Tier is roughly 50% cheaper per unit.
- S1 (Standard): ~$25/unit for 400k messages/day.
- B1 (Basic): ~$10/unit for 400k messages/day. Note: Basic tier does not support Direct Methods or C2D messaging.
Does “Message Routing” or “Enrichment” cost extra?
Routing and Message Enrichments (stamping data with tags like TruckID) are free of charge in terms of processing. However, keep an eye on the total size. If adding an enrichment pushes your message from 3.9KB to 4.1KB, you will suddenly be billed for two chunks instead of one.
What about “Compression”? Is it worth it on an ESP32?
For air quality or vibration data that is repetitive, compression is a game-changer. Using a library like miniz or zlib on the ESP32, you can often compress your JSON by 70–80%. This allows you to fit hundreds of sensor readings into a single 4KB billed message.
Implementation Comparison: The 1,000 Device Fleet
| Strategy | Messages per Day | Billed Chunks | Est. Monthly Cost |
|---|---|---|---|
| Raw (Every 1 min) | 1,440,000 | 1,440,000 | ~$125.00 (5 Units S1) |
| Batched (Every 30 mins) | 48,000 | 48,000 | $25.00 (1 Unit S1) |
| Batched + Basic Tier | 48,000 | 48,000 | $10.00 (1 Unit B1) |
Further Links
- Architecture best practices for Azure IoT Hub
- Azure-Samples/iot-reliable-edge-relay - A Reliable Edge Relay is a micro-pattern that demonstrates an reliable streaming data ingestion from the Edge.
Conclusion
FinOps for IoT isn’t about using less data; it’s about being a smarter “shipper.” By filling your 4KB chunks and choosing the right tier, you can support a massive fleet on a hobbyist’s budget.
Photo by Jakub Żerdzicki on Unsplash




Comments
Add Comment