October 5, 2025
blob trigger vs event grid

Solving Azure Blob Trigger Delays by Switching to Event Grid

About a year ago, I set up an Azure Function App that would fire whenever a file was uploaded to a specific container in Blob Storage. It was one of those setups that felt almost magical, upload a file, the function wakes up, processes it, and moves on. For months, it worked exactly as expected. But, it gradually started to slip as the number of files in the container grew and traffic increased.

The Unexpected Delay Blob Triggers

After running smoothly for months, I started noticing something strange. Some files were processed within minutes of upload, no big deal. But some files sat in the container for up to five days before the function processed them, the processing itself was instant, no errors, no crashes. The function itself was fine. No failures. Whenever it ran, it worked perfectly. The real issue was that the trigger, the “hey, a new blob is here!” signal was showing up late. Some times very late.

The Root Cause

So, I dug deeper. Looking at the logs, I noticed something important: the detection source was listed as ContainerScan. That was my “aha” moment. Blob Triggers don’t actually get notified in real time when a new blob appears. It rely on a polling mechanism essentially, Azure scans the storage account at intervals to discover new blobs. As the storage grew, more blobs, deeper folder hierarchies, and heavier traffic, this scanning process slowed. Eventually, it hit a point where the detection delay was no longer acceptable and reliable. Some blobs were processed the same day, others languished unnoticed for days.

Blob Triggers rely on periodic polling of the storage container to detect new blobs

The Fix: Event Grid to the Rescue

I found that Blob Triggers weren’t designed for real-time, high-volume scenarios. That’s where Event Grid comes in. Unlike Blob Triggers, Event Grid operates on a push model, Azure sends an event the moment a blob is created, and the function receives it almost instantly. So, we rewired our architecture, instead of relying on Blob Triggers, we subscribed the Function App to Blob Created events via Event Grid. After migrating the function to use Event Grid triggers, files began processing in under a second after upload and performance was stable even as blob count and traffic continued to grow.

Event Grid operates on a push model, Azure sends an event the moment a blob is created

Event Grid doesn’t just trigger Azure Functions. It can also call any HTTP endpoint, which means you can notify an external system, trigger a webhook in a third-party app, or even integrate directly with your own APIs. This flexibility makes Event Grid a much stronger choice than relying solely on Blob Triggers.

To use Event Grid with Azure Functions, we need to update the function signature to accept an EventGridEvent instead of a Blob.

import logging
import azure.functions as func

def main(event: func.EventGridEvent):
    logging.info('Event Grid event received')

    # Parse the event payload
    event_data = event.get_json()
    blob_url = event_data.get('url')

    logging.info(f'Blob created at: {blob_url}')

    # Here you can add your processing logic,
    # e.g., download the blob, transform, move, etc.

What I Learned

  • Blob Triggers are fine for small workloads or where near-real-time isn’t critical.
  • Event Grid is essential for high-volume, low-latency scenarios.
  • Monitor your system and don’t wait until things break. The signs were there early small delays that grew over time. If I’d paid attention sooner, I could have avoided a lot of frustration.

Final Thoughts

If you’re relying on Blob Triggers and your workload is growing, don’t wait for five-day delays to surprise you. Consider switching early, you’ll thank yourself later.

2 thoughts on “Solving Azure Blob Trigger Delays by Switching to Event Grid

  1. blob triggers are actually buggy
    – they don’t pick up all the updates that occur during the sweep.
    – they set the high water mark to the highest timestamp seen anywhere in the sweep – so if something at the end of the scan is modified late and at the same time as something at the beginning of the scan, the high water mark will be moved past the ‘late’ point and the begnning of the scan change will be incorrectly skipped as ‘already seen’.
    – documentation for blob trigger is also a bit wrong – any storage account with 5000* blobs or more might be exposed to this pattern
    *documented as being variable and subject to unspecified system limitations

    1. Another issue I discovered with the blob trigger is that when a new Azure Function is configured to run on a blob-created event, it doesn’t only react to new uploads. Instead, it is triggered for all existing files in the storage account first, before it starts listening only for new ones.

Leave a Reply to Bird Cancel reply

Your email address will not be published. Required fields are marked *