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/includes/register-provider-cli.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,13 +11,13 @@
11
11
12
12
## Enable the Event Grid resource provider
13
13
14
-
1. If you haven't previously used Event Grid in your Azure subscription, you might need to register the Event Grid resource provider. Run the following command to register the provider:
14
+
1. If this article is the first time that user use Event Grid in your Azure subscription, you might need to register the Event Grid resource provider. Run the following command to register the provider:
15
15
16
16
```azurecli-interactive
17
17
az provider register --namespace Microsoft.EventGrid
18
18
```
19
19
20
-
2. It might take a moment for the registration to finish. To check the status, run the following command:
20
+
1. It might take a moment for the registration to finish. To check the status, run the following command:
21
21
22
22
```azurecli-interactive
23
23
az provider show --namespace Microsoft.EventGrid --query "registrationState"
Copy file name to clipboardExpand all lines: articles/event-grid/publish-events-using-namespace-topics.md
+32-21Lines changed: 32 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,16 +10,24 @@ ms.date: 02/20/2024
10
10
11
11
# Publish to namespace topics and consume events in Azure Event Grid
12
12
13
-
This article provides a quick introduction to pull delivery using the ``curl`` bash shell command to publish, receive, and acknowledge events. Event Grid resources are created using CLI commands. This article is suitable for a quick test of the pull delivery functionality. For sample code using the data plane SDKs, see the [.NET](event-grid-dotnet-get-started-pull-delivery.md) or the Java samples. For Java, we provide the sample code in two articles: [publish events](publish-events-to-namespace-topics-java.md) and [receive events](receive-events-from-namespace-topics-java.md) quickstarts.
14
-
For more information about the pull delivery model, see the [concepts](concepts-event-grid-namespaces.md) and [pull delivery overview](pull-delivery-overview.md) articles.
13
+
This article provides a quick introduction to pull delivery using the `curl` bash shell command to publish, receive, and acknowledge events. Use Azure CLI commands to create Azure Event Grid resources. This article is suitable for a quick test of the pull delivery functionality.
14
+
15
+
For sample code that uses the data plane SDKs, see these resources:
16
+
17
+
- .NET: [Send and receive messages from an Azure Event Grid namespace topic (.NET)](event-grid-dotnet-get-started-pull-delivery.md)
18
+
- Java: [Publish events to namespace topics using Java](publish-events-to-namespace-topics-java.md)
19
+
- Java: [Receive events using pull delivery with Java](receive-events-from-namespace-topics-java.md)
20
+
21
+
For more information about the pull delivery model, see [Azure Event Grid namespace concepts](concepts-event-grid-namespaces.md) and [Pull delivery with HTTP](pull-delivery-overview.md) articles.
- This article requires version 2.0.70 or later of the Azure CLI. If using Azure Cloud Shell, the latest version is already installed.
27
+
- This article requires version 2.0.70 or later of the Azure CLI. If you use Azure Cloud Shell, the latest version is already installed.
21
28
22
29
## Create a resource group
30
+
23
31
Create an Azure resource group with the [az group create](/cli/azure/group#az-group-create) command. You use this resource group to contain all resources created in this article.
24
32
25
33
The general steps to use Cloud Shell to run commands are:
@@ -33,7 +41,7 @@ The general steps to use Cloud Shell to run commands are:
33
41
```azurecli-interactive
34
42
resource_group="<your-resource-group-name>"
35
43
```
36
-
2. Create a resource group. Change the location as you see fit.
44
+
1. Create a resource group. Change the location as you see fit.
37
45
38
46
```azurecli-interactive
39
47
az group create --name $resource_group --location eastus
@@ -48,14 +56,14 @@ An Event Grid namespace provides a user-defined endpoint to which you post your
48
56
- It should be between 3-50 characters.
49
57
- It should be regionally unique.
50
58
- Only allowed characters are a-z, A-Z, 0-9 and -
51
-
- It shouldn't start with reserved key word prefixes like `Microsoft`, `System` or `EventGrid`.
59
+
- It shouldn't start with reserved key word prefixes like `Microsoft`, `System`, or `EventGrid`.
52
60
53
61
1. Declare a variable to hold the name for your Event Grid namespace. Specify a name for the namespace by replacing `<your-namespace-name>` with a value you like.
54
62
55
63
```azurecli-interactive
56
64
namespace="<your-namespace-name>"
57
65
```
58
-
2. Create a namespace. You might want to change the location where it's deployed.
66
+
1. Create a namespace. You might want to change the location where you deploy it.
59
67
60
68
```azurecli-interactive
61
69
az eventgrid namespace create -g $resource_group -n $namespace -l eastus
@@ -70,22 +78,22 @@ Create a topic that's used to hold all events published to the namespace endpoin
Create an event subscription setting its delivery mode to *queue*, which supports [pull delivery](pull-delivery-overview.md). For more information on all configuration options,see the latest Event Grid control plane [REST API](/rest/api/eventgrid).
89
+
Create an event subscription setting its delivery mode to *queue*, which supports [pull delivery](pull-delivery-overview.md). For more information on all configuration options,see [Azure Event Grid REST API](/rest/api/eventgrid).
82
90
83
91
1. Declare a variable to hold the name for an event subscription to your namespace topic. Specify a name for the event subscription by replacing `<your-event-subscription-name>` with a value you like.
The `data` element is the payload of your event. Any well-formed JSON can go in this field. For more information on properties (also known as context attributes) that can go in an event, see the [CloudEvents](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md) specifications.
124
-
3. Use CURL to send the event to the topic. CURL is a utility that sends HTTP requests.
131
+
The `data` element is the payload of your event. Any well-formed JSON can go in this field. Properties that can go into an event are also known as *context attributes*. For more information, see [CloudEvents](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md).
132
+
133
+
1. Use CURL to send the event to the topic. CURL is a utility that sends HTTP requests.
curl -X POST -H "Content-Type: application/json" -H "Authorization:SharedAccessKey $key" $receive_operation_uri
143
153
```
144
154
145
155
### Acknowledge an event
146
156
147
-
After you receive an event, you pass that event to your application for processing. Once you have successfully processed your event, you no longer need that event to be in your event subscription. To instruct Event Grid to delete the event, you **acknowledge** it using its lock token that you got on the receive operation's response.
157
+
After you receive an event, you pass that event to your application for processing. After you successfully process your event, you no longer need that event to be in your event subscription. To instruct Event Grid to delete the event, you **acknowledge** it using its lock token that you got on the receive operation's response.
148
158
149
-
1. In the previous step, you should have received a response that includes a `brokerProperties` object with a `lockToken` property. Copy the lock token value and set it on an environment variable:
159
+
1. In the previous section, you received a response that includes a `brokerProperties` object with a `lockToken` property. Copy the lock token value and set it on an environment variable:
150
160
151
161
```azurecli-interactive
152
162
lockToken="<paste-the-lock-token-here>"
153
163
```
154
-
2. Now, build the acknowledge operation payload, which specifies the lock token for the event you want to be acknowledged.
164
+
1. Now, build the acknowledge operation payload, which specifies the lock token for the event you want to be acknowledged.
0 commit comments