Skip to content
  • English Deutsch

benjamin-abt.com

Performance is a feature | Cloud - AI - Azure - .NET - Sustainability

  • Home
  • Blog
  • Portfolio
    • Overview
    • Workshops & Training
    • Publications
  • Contact
  • Home
  • Blog

Store Messages of Azure IoT Hub to Azure Blob Storage

Store Messages of Azure IoT Hub to Azure Blob Storage
March 13, 2020 4 min read BEN ABT
Azure IoT IoT Hub Azure Blob Storage Azure Functions Azure Event Grid

This article was written in 2020. Versions, tools and recommendations may have changed since then. Newer posts are collected under Azure.

In most cases, Azure IoT Hub messages should be stored for a longer period of time.

In fact, there are several ways to achieve this goal - and there are huge differences in performance and price.

Azure IoT Hub - Storage Endpoint

The way messages are processed in Azure IoT Hub are endpoints: these endpoints are usually other Azure products or services. By default, the Azure IoT Hub supports storage routing either towards Azure Blob Storage or into Azure Data Lake Storage .
Azure Blob Storage is an extremely cost-effective product in this respect, as it is only a hard disk storage space, whereas Data Lake is a separate Azure service.

In the case of Azure Blob Storage, the data is stored in the so-called AVRO format by. Apache AVRO is a very common data format in data analysis and has its origin in the Apache Hadoop project.
If you do not want AVRO as format, you can alternatively save it in JSON format.

The disadvantage of direct storage is that it causes additional costs - per endpoint. The format and structure of how data is stored is also fixed or very limited.
I basically recommend this variant only for proof-of-concepts or very small, simple projects.

Azure IoT Hub - Azure Function Endpoint

Some code is required if you want to have the saving process in your own hands: and write a small Azure Function accordingly.

This function has a trigger for new IoT hub messages and the trigger stores the data in an Azure Blob Storage Container via the Azure Storage SDK.

The disadvantage is the code that you have to program yourself - but especially for smaller scenarios with less messages you usually have a cheaper setup, because the costs for direct storage are omitted or the Azure Function simply costs less.

This scenario also supports the Azure IoT Hub in the free version and you may even get out of the whole thing for free, even if the message processing by Azure Function remains below the chargeable limit.

Azure IoT Hub - Event Grid as proxy

The Azure IoT Hub has certain limits on the number of endpoints and generates additional costs when messages are stored directly in the storage. Furthermore, this scenario is not considered as “high-performance”.

The alternative for direct storage by the IoT Hub is the Event Grid.

Azure Event Grid is a service in Azure that has been trimmed for high-performance and can also tap the Azure IoT Hub as an event source.

The idea here is that the Event Grid is no longer the IoT Hub but the central point for all event processing. The advantages are:

  • Higher overall performance
  • More endpoint capabilities
  • More source possibilities; also HTTP and Azure Functions
  • The free version of the IoT Hub can also be used as a source

Especially the fact that other sources are possible in the Event Grid is a very big plus.

In almost all my IoT projects I have sensor sources, which unfortunately are not provided by the IoT Hub but by external webhooks. This is a particularly common scenario in home automation and sensor data coming from external service providers.

The Event Grid is the only product that offers me this flexibility: many different sources, many different destinations and very high performance at low, scalable costs.

Unfortunately, the messages coming from the IoT Hub to the Event Grid cannot be stored directly in the storage. For this I usually use an Azure Function, which is called by the Event Grid (better said the Azure Function has a trigger on an Event Grid event).

The advantage, however, is that I have control over the structure and format in which I store my data.

Hot Path vs Cold Path

Storage from the Azure IoT Hub directly into the blob storage is a so-called cold path: data is stored directly into a cold storage - the blob storage.

Routing, for example, directly into a streaming service that offers quasi real-time message processing - would be a hot path.

Related articles

Azure IoT: send messages with C#

Aug 8, 2019 - 2 min read

Azure IoT: send messages with C#

Requirements You must have created an IoT Hub in Azure. You must have created a device in your created Azure IoT Hub . You need the …

Setting up an Azure IoT Hub

Aug 2, 2019 - 2 min read

Setting up an Azure IoT Hub

The Azure IoT Hub is a highly scalable, secure platform for the bidirectional communication of devices and software components in the sense …

Run Hono on Azure Static Web Apps: managed Functions APIs for static frontends

Jul 19, 2026 - 8 min read

Run Hono on Azure Static Web Apps: managed Functions APIs for static frontends

Azure Static Web Apps is primarily a host for static frontend assets, but it can also deploy a small HTTP API alongside the frontend. That …


BEN ABT

BEN ABT

Ben is Chief Engineering Officer and Principal Software Engineer at Medialesson.de, with a strong focus on .NET and Microsoft Azure. In his professional role, he designs and builds highly scalable platforms for hybrid and cloud-based scenarios. He also advises companies and C-levels on migrating to the sovereign cloud.

He runs myCSharp.de, the largest and most active German-speaking C# community forum, actively contributes to both his own and external open-source projects and regularly shares his knowledge through his blog, at community events, conferences and as a writer for technical magazines.

Let's Work Together

Looking for an experienced Platform Architect or Engineer for your next project? Whether it's cloud migration, platform modernization or building new solutions from scratch - I'm here to help you succeed.

New Platforms

Modernization

Training & Consulting

Contact Me
X Facebook LinkedIn WhatsApp
Back Next Blog Post

Open for work!

Contact Me
BEN ABT BEN ABT Software Engineer · Microsoft MVP Passionate about .NET, Azure, performance optimization and sustainable software engineering.

Medialesson GmbH Logo

Microsoft MVP Logo

Recent posts

View all
Stop Using nginx as Your Default Static File Server in Docker

Stop Using nginx as Your Default Static File Server in …

Oct 24, 2026
Containerizing .NET in 2026 Without a Dockerfile

Containerizing .NET in 2026 Without a Dockerfile

Oct 20, 2026
Problem Details in ASP.NET Core and .NET 11

Problem Details in ASP.NET Core and .NET 11

Oct 5, 2026
Resilience in .NET with Microsoft.Extensions.Resilience

Resilience in .NET with Microsoft.Extensions.Resilience

Sep 21, 2026
What Matters in ASP.NET Core 11

What Matters in ASP.NET Core 11

Sep 14, 2026

Tags

.NET (192) Csharp (96) ASP.NET Core (48) Azure (41) DevOps (17) Docker (14) Microsoft (14) EF Core (11) Microsoft MVP (11) AI (10) GitHub (10) GitHub Copilot (10) ASP.NET (9) Security (9) Synology (9) Architecture (8) Raspberry (8) Azure Functions (7) Cloudflare (7) Bicep (6)
benjamin-abt.com

About BEN

Benjamin Abt is a Software Engineer, Platform Architect and Microsoft MVP specializing in .NET, Azure, cloud architecture, performance optimization and sustainable software development.

Connect

  • Follow me on GitHub
  • Follow me on LinkedIn
  • Follow me on Mastodon
  • Microsoft MVP profile
  • Follow SchwabenCode on GitHub
  • Follow me on X

Quick Links

  • Portfolio
  • Blog
  • Workshops & Training
  • Publications
  • Get in Touch
  • Sitemap
Open for Work

© Copyright Benjamin Abt & SchwabenCode | 2011 - 2026

Content licensed under CC BY 4.0 unless otherwise noted.

  • Impressum
  • Privacy
  • Contact