Event Grid Blob-Created to Ingestion Pipeline
Subscribed to Azure Event Grid blob-created events, the flow validates each new file, routes it by type, kicks off the right processing (OCR, parse, load to Dataverse/SQL), and reports outcomes to Teams. Gives event-driven, low-latency file ingestion instead of polling storage.
Provided as-is, without warranty of any kind. Review and test each pattern in a non-production environment before deploying it to live automations. See our Terms.
Overview
This flow delivers event-driven, low-latency file ingestion using Azure Event Grid. It subscribes to Microsoft.Storage.BlobCreated events on a source storage account, validates that each new blob is in the monitored container scope, reads the blob content from Azure Blob Storage, routes the file to the correct processing pipeline by extension, and writes a full audit row to a Dataverse ingestion-log table - every row stamped with a correlation id for end-to-end traceability.
Why it matters: polling storage is laggy and wasteful. Event Grid pushes each blob event the moment it lands, so ingestion is responsive and scales without timer churn.
Ships Off (demo).
Use Case
Files arrive in Blob Storage from external systems, partners, or upstream jobs and must be processed the instant they land - not on the next polling cycle. This flow is the entry point of an event-driven ingestion pipeline: it captures the event, fetches the file, decides which downstream pipeline (OCR, parse, image, archive) should handle it, and records an auditable log entry for every file (including ones skipped because they fall outside the monitored container).
Flow Architecture
When A Blob Is Created Event Occurs
Azure Event Grid - CreateSubscription (webhook)Fires on Microsoft.Storage.BlobCreated; splitOn fans each batched event into its own run.
Initialize Trace & Config
Initialize variableMints a correlation id and binds the storage account, extension route map, container subject prefix, and status label from env vars.
Parse Blob Metadata & Route
ComposeDerives the blob URL, subject, name, extension, content type, and size from the event payload and resolves the pipeline route with a default fallback.
Scope Check
ConditionProcesses only blobs whose subject begins with the monitored container prefix.
Fetch & Route
Azure Blob Storage - GetFileContentByPath_V2 + SwitchReads the blob content and branches the processing pipeline by route (OCR / Parse / Image / Archive).
Log Outcome
Microsoft Dataverse - CreateRecordWrites the audit row (correlation id, metadata, route, status); out-of-scope blobs are logged as Skipped.
Environment Variables
| Schema name | Type | Default | Description |
|---|---|---|---|
| flowlibs_StorageAccount | String | flowlibsstorage | Source storage account name; used as the Azure Blob dataset. |
| flowlibs_TypeRouteMap | String | {"pdf":"OCR","csv":"Parse","json":"Parse","xlsx":"Parse","png":"Image","jpg":"Image","default":"Archive"} | JSON map of file extension to processing pipeline. |
| flowlibs_EventGridSubscriptionId | String | <your-subscription-id> | Azure subscription the trigger subscribes to. |
| flowlibs_EventGridStorageTopic | String | /subscriptions/<your-subscription-id>/resourceGroups/<your-rg>/providers/Microsoft.Storage/storageAccounts/flowlibsstorage | ARM resource id of the storage account (Event Grid system-topic scope). |
| flowlibs_BlobSubjectPrefix | String | /blobServices/default/containers/incoming/blobs/ | subjectBeginsWith-style filter scoping ingestion to one container. |
Connectors & Connections
| Connector | API name | Actions used |
|---|---|---|
| Azure Event Grid | shared_azureeventgrid | CreateSubscription (trigger) |
| Azure Blob Storage | shared_azureblob | GetFileContentByPath_V2 |
| Microsoft Dataverse | shared_commondataserviceforapps | CreateRecord |
Note — All connections are referenced as solution connection references; the flow is portable between environments as long as a connection is mapped at import time.
Customization Guide
Almost every realistic variant of this flow can be implemented by changing environment variable values. A few cases require small edits inside the flow definition — those are called out explicitly below.
- Subject filters
- Change the blob subject prefix to scope to a different container/prefix, or relax it to ingest all containers.
- Routing
- Edit the type route map to add extensions or pipeline names; add matching Switch cases for new routes.
- Real processing
- Replace each Switch case's Compose note with the actual downstream action (Document Intelligence/OCR, parse-and-load, image analysis, archive copy).
- Dead-letter / large files
- Route failures to a queue and hand very large files to Azure Functions or Data Factory.
- Idempotency
- For production, de-duplicate on blob path + eTag before processing to guard against repeated deliveries.
Key Expressions
The flow is intentionally light on Power Fx / WDL gymnastics — the heaviest expressions are the branch-name concatenation and the approval outcome check. They are listed below in the order they appear in the flow.
EXPR.01Route lookup
Resolves the pipeline for this extension, falling back to default.
EXPR.02Account-relative blob path
Builds the /container/blob path for the Blob read.
EXPR.03In-scope check
True when the blob is under the monitored container prefix.
Comments
Sign in to join the conversation.
Sign inNo comments yet. Be the first to share your experience with this flow.