Storage queue as an event handler for Azure Event Grid events

An event handler is the place where the event is sent. The handler takes some further action to process the event. Several Azure services are automatically configured to handle events and Azure Queue Storage is one of them.

Use Queue Storage to receive events that need to be pulled. You might use Queue storage when you have a long running process that takes too long to respond. By sending events to Queue storage, the app can pull and process events on its own schedule.

Tutorials

See the following tutorial for an example of using Queue storage as an event handler.

Title Description
Quickstart: route custom events to Azure Queue storage with Azure CLI and Event Grid Describes how to send custom events to a Queue storage.

REST examples (for PUT)

Storage queue as the event handler

{
	"properties": 
	{
		"destination": 
		{
			"endpointType": "StorageQueue",
			"properties": 
			{
				"resourceId": "/subscriptions/<AZURE SUBSCRIPTION ID>/resourceGroups/<RESOURCE GROUP NAME>/providers/Microsoft.Storage/storageAccounts/<STORAGE ACCOUNT NAME>",
				"queueName": "<QUEUE NAME>"
			}
		},
		"eventDeliverySchema": "EventGridSchema"
	}
}

Storage queue as the event handler - delivery with managed identity

{
	"properties": 
	{
		"deliveryWithResourceIdentity": 
		{
			"identity": 
			{
				"type": "SystemAssigned"
			},
			"destination": 
			{
				"endpointType": "StorageQueue",
				"properties": 
				{
					"resourceId": "/subscriptions/<AZURE SUBSCRIPTION ID>/resourceGroups/<RESOURCE GROUP NAME>/providers/Microsoft.Storage/storageAccounts/<STORAGE ACCOUNT NAME>",
					"queueName": "<QUEUE NAME>"
				}
			}
		},
		"eventDeliverySchema": "EventGridSchema"
	}
}

Storage queue as the event handler with a deadletter destination

{
	"name": "",
	"properties": 
	{
		"destination": 
		{
			"endpointType": "StorageQueue",
			"properties": 
			{
				"resourceId": "/subscriptions/<AZURE SUBSCRIPTION ID>/resourceGroups/<RESOURCE GROUP NAME>/providers/Microsoft.Storage/storageAccounts/<DESTINATION STORAGE>",
				"queueName": "queue1"
			}
		},
		"eventDeliverySchema": "EventGridSchema",
		"deadLetterDestination": 
		{
			"endpointType": "StorageBlob",
			"properties": 
			{
				"resourceId": "/subscriptions/<AZURE SUBSCRIPTION ID>/resourceGroups/<RESOURCE GROUP NAME>/providers/Microsoft.Storage/storageAccounts/<DEADLETTER STORAGE>",
				"blobContainerName": "test"
			}
		}
	}
}

Storage queue as the event handler with a deadletter destination - managed identity

{
	"properties": 
	{
		"destination": 
		{
			"endpointType": "StorageQueue",
			"properties": 
			{
				"resourceId": "/subscriptions/<AZURE SUBSCRIPTION ID>/resourceGroups/<RESOURCE GROUP NAME>/providers/Microsoft.Storage/storageAccounts/<DESTINATION STORAGE>",
				"queueName": "queue1"
			}
		},
		"eventDeliverySchema": "EventGridSchema",
		"deadLetterWithResourceIdentity": 
		{
			"identity": 
			{
				"type": "SystemAssigned"
			},
			"deadLetterDestination": 
			{
				"endpointType": "StorageBlob",
				"properties": 
				{
					"resourceId": "/subscriptions/<AZURE SUBSCRIPTION ID>/resourceGroups/<RESOURCE GROUP NAME>/providers/Microsoft.Storage/storageAccounts/<DEADLETTER STORAGE>",
					"blobContainerName": "test"
				}
			}
		}
	}
}

Next steps

See the Event handlers article for a list of supported event handlers.