Share via

Function App deadlock when merge >10k entities to azure data table

Phillip 0 Reputation points
2026-06-08T12:01:59.0566667+00:00

Hey, We have a Function App in Flex Consumption Plan with nodejs that reads a CSV file (50k rows, 2 mb) add merges that row by row to a azure data table. The rows a added one after another. After ~10k rows the function stops logging to application insight, no error and nothing inside the invocations overview. I tried to figure out, if it happens because of any quotas, but memory is low and the duration is ~3 min.

When introducing batch, e.g. merge 10 rows in parallel, it works.

It might be a good solution to use batching, but I am curious what causes the issue. Any idea?

Info: I cannot use transaction based batching as I having unique partition keys

Appreciate your help!

Best,
Phillip

Azure Functions
Azure Functions

An Azure service that provides an event-driven serverless compute platform.


1 answer

Sort by: Most helpful
  1. Alex Burlachenko 22,200 Reputation points MVP Volunteer Moderator
    2026-06-22T11:13:33.05+00:00

    Phillip hi , thx for sharing urs issue here at Q&A portal,

    the function is getting stuck on the async/storage side, not hitting a hard memory or duration limit.

    Doing 50k table merges one-by-one is a lot of round trips. After ~10k ops, u may be running into slow retries, socket exhaustion, throttling, or the Node event loop getting backed up. App Insights can also go quiet if the worker is still alive but stuck waiting on pending I/O. The fact that 10 parallel merges works is a good clue. It means the storage account/table can handle the load, but the fully sequential pattern is prob too slow or getting trapped in retries somewhere.

    Since u have unique partition keys, normal transactional batch won’t help, yeah. https://learn.microsoft.com/en-us/rest/api/storageservices/performing-entity-group-transactions

    Best fix is what u already tested process in small chunks with controlled concurrency, like 10-50 at a time, plus retry/backoff for 429, 503, and timeouts. Don’t fire all 50k at once tho, that just moves the fire from the kitchen to the garage.

    Worth logging every 500 or 1000 rows with the current row number and catching/logging each failed merge. I’d also log SDK retry attempts if possible, because my guess is the function isn’t deadlocked, it’s sitting inside storage SDK retries or waiting on network I/O.

    For longer imports, Durable Functions or a queue-based fan-out is cleaner. Put rows/chunks onto a queue and let multiple function executions process them. https://learn.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-overview So yeah, batching is not just a workaround here. For 50k remote table writes, controlled concurrency is basically the right design.

    rgds,

    Alex

    &

    If my answer was helpful pls mark it and additional thx if u follow me at Q&A portal

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.