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

Efficient deserialization of Json files on Azure Blob Storage with .NET

Efficient deserialization of Json files on Azure Blob Storage with .NET
March 15, 2023 1 min read BEN ABT
.NET Azure

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

System.Text.Json is currently the most modern way to handle Json files efficiently. Efficiency here also means that memory sparing files are read in.

A very efficient way to handle Json files is not to load them into a string first, but to implement the deserialization via streams. This keeps the application more scalable and performant.

System.Text.Json has this built in, so such an implementation can be done within a few lines.

C#
 1// Create Client
 2BlobContainerClient container = new(_options.ConnectionString, _options.ContainerName);
 3BlobClient blobClient = container.GetBlobClient(_options.BlobPath);
 4
 5// check if blob exists
 6Azure.Response<bool> exists = await blobClient.ExistsAsync(ct).ConfigureAwait(false);
 7if (exists.Value is false)
 8{
 9    return null;
10}
11
12// Get Blob Stream
13BlobOpenReadOptions readOptions = new(allowModifications: false);
14using Stream stream = await blobClient.OpenReadAsync(readOptions, ct).ConfigureAwait(false);
15
16// read json
17JsonSerializerOptions jsonOpions = new();
18
19MyDeserializationTargetClass? myDeserializedObject = await JsonSerializer
20    .DeserializeAsync<MyDeserializationTargetClass>(stream, jsonOpions, ct)
21    .ConfigureAwait(false);

Related articles

Automatic TTL in Azure Cosmos DB with .NET

Aug 17, 2026 - 17 min read

Automatic TTL in Azure Cosmos DB with .NET

Temporary data is easy to create and surprisingly difficult to remove reliably. Sessions, idempotency keys, import buffers, transient …

Top 10 recommendations for .NET developers working with Azure Cosmos DB

Jul 10, 2026 - 11 min read

Top 10 recommendations for .NET developers working with Azure Cosmos DB

Azure Cosmos DB has a habit of exposing architectural weaknesses very early. Classic data-access patterns that work perfectly fine with …

Local Aspire Development with Azure Cosmos DB and the Preview Emulator

Jun 24, 2026 - 14 min read

Local Aspire Development with Azure Cosmos DB and the Preview Emulator

Distributed applications tend to feel straightforward until a real cloud dependency enters the picture. Azure Cosmos DB is a good example. …


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