You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/event-grid/custom-event-to-queue-storage.md
+10-9Lines changed: 10 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,26 +1,27 @@
1
1
---
2
2
title: 'Quickstart: Send custom events to a queue - Event Grid, Azure CLI'
3
3
description: Learn how to use Azure Event Grid and the Azure CLI to publish a topic and subscribe to that event, by using a queue for the endpoint.
4
-
ms.date: 01/31/2024
4
+
ms.date: 06/24/2025
5
5
ms.topic: quickstart
6
6
ms.custom: devx-track-azurecli, mode-api
7
+
#customer intent: As a developer, I want to use Azure Event Grid to integrate applications by using events.
7
8
---
8
9
9
10
# Quickstart: Route custom events to a queue by using Event Grid and the Azure CLI
10
11
11
-
[Azure Event Grid](overview.md) is a highly scalable and serverless event broker that you can use to integrate applications via events. Event Grid delivers events to supported event handlers, such as Azure Queue storage. For more information, see [Event handlers](event-handlers.md).
12
-
13
12
In this quickstart, you use the Azure CLI to create an Event Grid custom topic and a Queue Storage subscription for that topic. You then send sample events to the custom topic and verify that those events are delivered to a queue.
14
13
14
+
[Azure Event Grid](overview.md) is a highly scalable and serverless event broker that you can use to integrate applications via events. Event Grid delivers events to supported event handlers, such as Azure Queue storage. For more information, see [Event handlers](event-handlers.md).
Event Grid topics are Azure resources, and they must be placed in an Azure resource group. The resource group is a logical collection into which Azure resources are deployed and managed.
20
+
Event Grid topics are Azure resources. Place them in an Azure resource group. The resource group is a logical collection in which Azure resources are deployed and managed.
20
21
21
22
Create a resource group by using the [az group create](/cli/azure/group#az-group-create) command. The following example creates a resource group named `gridResourceGroup` in the `westus2` location.
22
23
23
-
Select **Open Cloud Shell** to open Azure Cloud Shell on the right pane. Select the **Copy** button to copy the command, paste it in Cloud Shell, and then select the Enter key to run the command.
24
+
Select **Open Cloud Shell** to open Azure Cloud Shell on the right pane. Select the **Copy** button to copy the command, paste it in Cloud Shell, and then select the **Enter** key to run the command.
24
25
25
26
```azurecli-interactive
26
27
az group create --name gridResourceGroup --location westus2
@@ -68,7 +69,7 @@ Before you subscribe to the custom topic, create the endpoint for the event mess
68
69
69
70
## Subscribe to a custom topic
70
71
71
-
The following example subscribes to the custom topic that you created, and it passes the resource ID of the queue for the endpoint. With the Azure CLI, you pass the queue ID as the endpoint. The endpoint is in this format:
72
+
The following example subscribes to the custom topic that you created. It passes the resource ID of the queue for the endpoint. With the Azure CLI, you pass the queue ID as the endpoint. The endpoint is in this format:
72
73
73
74
`/subscriptions/<AZURE SUBSCRIPTION ID>/resourcegroups/<RESOURCE GROUP NAME>/providers/Microsoft.Storage/storageAccounts/<STORAGE ACCOUNT NAME>/queueservices/default/queues/<QUEUE NAME>`
74
75
@@ -89,7 +90,7 @@ az eventgrid event-subscription create \
89
90
--expiration-date "<yyyy-mm-dd>"
90
91
```
91
92
92
-
The account that creates the event subscription must have write access to the queue. Notice that an expiration date is set for the subscription.
93
+
The account that creates the event subscription must have write access to the queue. An expiration date is set for the subscription.
93
94
94
95
If you use the REST API to create the subscription, you pass the ID of the storage account and the name of the queue as a separate parameter:
For the sake of simplicity in this article, you use sample event data to send to the custom topic. Typically, an application or an Azure service would send the event data.
116
+
For simplicity, this article uses sample event data to send to the custom topic. Typically, an application or an Azure service would send the event data.
116
117
117
118
The cURL tool sends HTTP requests. In this article, you use cURL to send the event to the custom topic. The following example sends three events to the Event Grid topic:
118
119
@@ -124,7 +125,7 @@ do
124
125
done
125
126
```
126
127
127
-
Go to the queue in the Azure portal, and notice that Event Grid sent those three events to the queue.
128
+
Go to the queue in the Azure portal to see that Event Grid sent those three events to the queue.
128
129
129
130
:::image type="content" source="./media/custom-event-to-queue-storage/messages.png" alt-text="Screenshot that shows a list of messages received from Event Grid in a queue.":::
0 commit comments