A simple event-driven sample demonstrating how to process queue messages locally using Azure Functions and the Azurite Storage Emulator.
This project simulates a lightweight purchase processing flow entirely on your local machine β perfect for experimenting with queue triggers and output bindings.
Azurite Queue (purchases)
β
Azure Function (ProcessPurchase)
β
Azurite Queue (purchases-processed)
-
QueueMessageSender β Console app that sends purchase messages to the purchases queue.
-
PurchaseProcessor β Azure Function project that processes messages and writes results to the purchases-processed queue.
βοΈ Prerequisites
- .NET 8 SDK
- Azurite
(VS Code extension or Docker) - Azure Functions Core Tools v4
- Azure Storage Explorer
(optional, for viewing queues)
Press Ctrl+Shift+P β Azurite: Start
This console app creates and sends mock purchase messages to Azurite.
cd QueueMessageSender
dotnet build
dotnet runYouβll be prompted for:
- Customer name
- Number of items
- Name, quantity, and price for each item
A message is then sent to the purchases queue.
The function listens for new messages on the purchases queue, processes them, and outputs to purchases-processed.
cd PurchaseProcessor
func startIf youβre running plain JSON (not Base64), make sure your host.json includes:
{
"version": "2.0",
"extensions": {
"queues": {
"messageEncoding": "none"
}
}
}Use Azure Storage Explorer to connect to your local Azurite instance and inspect both queues:
purchasesβ input queuepurchases-processedβ processed output messages
- QueueMessageSender sends a JSON message like:
{
"PurchaseId": "43ecd0e5-7f2d-4c5a-a5bc-9877783a61bf",
"CustomerId": "Customer-Id-01",
"Items": [
{ "Name": "Book", "Quantity": 1, "Price": 9.99 }
],
"Timestamp": "2025-11-06T14:27:47.4503265Z"
}
- The Function App:
- Logs receipt of the message
- Deserializes the JSON
- Adds a processed timestamp
- Writes the updated record to purchases-processed
- If message processing fails more than 5 times, itβs automatically moved to a poison queue named purchases-poison.
- Both input and output queues are fully emulated in Azurite β no Azure resources required.
.
βββ QueueMessageSender/ # Console app to send queue messages
βββ PurchaseProcessor/ # Azure Function project
β βββ ProcessPurchase.cs # Queue trigger function
β βββ host.json # Function host configuration
βββ README.mdThis project demonstrates a local-first, event-driven workflow using:
- Azurite for queue emulation
- Azure Functions (in-process model)
- A simple console producer and consumer pattern
Itβs a great foundation for experimenting with Azure Functions, message processing, and building local prototypes before deploying to the cloud.