Skip to content

Commit 0c9d360

Browse files
Merge pull request #116134 from spelluru/egridrest0521
REST JSON
2 parents d194e35 + 3bc5189 commit 0c9d360

File tree

6 files changed

+312
-0
lines changed

6 files changed

+312
-0
lines changed

articles/event-grid/handler-event-hubs.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,52 @@ If you use an **event hub** as an event handler for events from Event Grid, set
3535
| aeg-data-version | <p>Data version of the event.</p><p>Example: "1".</p><p>For **Event Grid event schema**, this property represents the data version and for **cloud event schema**, it doesn't apply.</p> |
3636
| aeg-output-event-id | ID of the Event Grid event. |
3737

38+
## REST examples (for PUT)
39+
40+
41+
### Event hub
42+
43+
```json
44+
{
45+
"properties":
46+
{
47+
"destination":
48+
{
49+
"endpointType": "EventHub",
50+
"properties":
51+
{
52+
"resourceId": "/subscriptions/<AZURE SUBSCRIPTION ID>/resourceGroups/<RESOURCE GROUP NAME>/providers/Microsoft.EventHub/namespaces/<EVENT HUBS NAMESPACE NAME>/eventhubs/<EVENT HUB NAME>"
53+
}
54+
},
55+
"eventDeliverySchema": "EventGridSchema"
56+
}
57+
}
58+
```
59+
60+
### Event hub - delivery with managed identity
61+
62+
```json
63+
{
64+
"properties": {
65+
"deliveryWithResourceIdentity":
66+
{
67+
"identity":
68+
{
69+
"type": "SystemAssigned"
70+
},
71+
"destination":
72+
{
73+
"endpointType": "EventHub",
74+
"properties":
75+
{
76+
"resourceId": "/subscriptions/<AZURE SUBSCRIPTION ID>/resourceGroups/<RESOURCE GROUP NAME>/providers/Microsoft.EventHub/namespaces/<EVENT HUBS NAMESPACE NAME>/eventhubs/<EVENT HUB NAME>"
77+
}
78+
}
79+
},
80+
"eventDeliverySchema": "EventGridSchema"
81+
}
82+
}
83+
```
3884

3985
## Next steps
4086
See the [Event handlers](event-handlers.md) article for a list of supported event handlers.

articles/event-grid/handler-functions.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,26 @@ For more information, see [Event Grid trigger for Azure Functions](../azure-func
2727
| [Tutorial: stream big data into a data warehouse](event-grid-event-hubs-integration.md) | When Event Hubs creates a Capture file, Event Grid sends an event to a function app. The app retrieves the Capture file and migrates data to a data warehouse. |
2828
| [Tutorial: Azure Service Bus to Azure Event Grid integration examples](../service-bus-messaging/service-bus-to-event-grid-integration-example.md?toc=%2fazure%2fevent-grid%2ftoc.json) | Event Grid sends messages from Service Bus topic to a function app and a logic app. |
2929

30+
## REST example (for PUT)
31+
32+
```json
33+
{
34+
"properties":
35+
{
36+
"destination":
37+
{
38+
"endpointType": "AzureFunction",
39+
"properties":
40+
{
41+
"resourceId": "/subscriptions/<AZURE SUBSCRIPTION ID>/resourceGroups/<RESOURCE GROUP NAME>/providers/Microsoft.Web/sites/<FUNCTION APP NAME>/functions/<FUNCTION NAME>",
42+
"maxEventsPerBatch": 1,
43+
"preferredBatchSizeInKilobytes": 64
44+
}
45+
},
46+
"eventDeliverySchema": "EventGridSchema"
47+
}
48+
}
49+
```
3050

3151
## Next steps
3252
See the [Event handlers](event-handlers.md) article for a list of supported event handlers.

articles/event-grid/handler-relay-hybrid-connections.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,24 @@ See the following tutorial for an example of using an Azure Relay hybrid connect
2222
|---------|---------|
2323
| [Tutorial: send events to hybrid connection](custom-event-to-hybrid-connection.md) | Sends a custom event to an existing hybrid connection for processing by a listener application. |
2424

25+
## REST example (for PUT)
26+
27+
```json
28+
{
29+
"properties":
30+
{
31+
"destination":
32+
{
33+
"endpointType": "HybridConnection",
34+
"properties":
35+
{
36+
"resourceId": "/subscriptions/<AZURE SUBSCRIPTION ID>/resourceGroups/<RESOURCE GROUP NAME>/providers/Microsoft.Relay/namespaces/<RELAY NAMESPACE NAME>/hybridconnections/<HYBRID CONNECTION NAME>"
37+
}
38+
},
39+
"eventDeliverySchema": "EventGridSchema"
40+
}
41+
}
42+
```
43+
2544
## Next steps
2645
See the [Event handlers](event-handlers.md) article for a list of supported event handlers.

articles/event-grid/handler-service-bus.md

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,96 @@ When sending an event to a Service Bus queue or topic as a brokered message, the
6666

6767
The event ID will be maintained across redelivery of the event so that you can avoid duplicate deliveries by turning on **duplicate detection** on the service bus entity. We recommend that you enable duration of the duplicate detection on the Service Bus entity to be either the time-to-live (TTL) of the event or max retry duration, whichever is longer.
6868

69+
## REST examples (for PUT)
70+
71+
### Service Bus queue
72+
73+
```json
74+
{
75+
"properties":
76+
{
77+
"destination":
78+
{
79+
"endpointType": "ServiceBusQueue",
80+
"properties":
81+
{
82+
"resourceId": "/subscriptions/<AZURE SUBSCRIPTION ID>/resourceGroups/<RESOURCE GROUP NAME>/providers/Microsoft.ServiceBus/namespaces/<SERVICE BUS NAMESPACE NAME>/queues/<SERVICE BUS QUEUE NAME>"
83+
}
84+
},
85+
"eventDeliverySchema": "EventGridSchema"
86+
}
87+
}
88+
```
89+
90+
### Service Bus queue - delivery with managed identity
91+
92+
```json
93+
{
94+
"properties": {
95+
"deliveryWithResourceIdentity":
96+
{
97+
"identity":
98+
{
99+
"type": "SystemAssigned"
100+
},
101+
"destination":
102+
{
103+
"endpointType": "ServiceBusQueue",
104+
"properties":
105+
{
106+
"resourceId": "/subscriptions/<AZURE SUBSCRIPTION ID>/resourceGroups/<RESOURCE GROUP NAME>/providers/Microsoft.ServiceBus/namespaces/<SERVICE BUS NAMESPACE NAME>/queues/<SERVICE BUS QUEUE NAME>"
107+
}
108+
}
109+
},
110+
"eventDeliverySchema": "EventGridSchema"
111+
}
112+
}
113+
```
114+
115+
### Service Bus topic
116+
117+
```json
118+
{
119+
"properties":
120+
{
121+
"destination":
122+
{
123+
"endpointType": "ServiceBusTopic",
124+
"properties":
125+
{
126+
"resourceId": "/subscriptions/<AZURE SUBSCRIPTION ID>/resourceGroups/<RESOURCE GROUP NAME>/providers/Microsoft.ServiceBus/namespaces/<SERVICE BUS NAMESPACE NAME>/topics/<SERVICE BUS TOPIC NAME>"
127+
}
128+
},
129+
"eventDeliverySchema": "EventGridSchema"
130+
}
131+
}
132+
```
133+
134+
### Service Bus topic - delivery with managed identity
135+
136+
```json
137+
{
138+
"properties":
139+
{
140+
"deliveryWithResourceIdentity":
141+
{
142+
"identity":
143+
{
144+
"type": "SystemAssigned"
145+
},
146+
"destination":
147+
{
148+
"endpointType": "ServiceBusTopic",
149+
"properties":
150+
{
151+
"resourceId": "/subscriptions/<AZURE SUBSCRIPTION ID>/resourceGroups/<RESOURCE GROUP NAME>/providers/Microsoft.ServiceBus/namespaces/<SERVICE BUS NAMESPACE NAME>/topics/<SERVICE BUS TOPIC NAME>"
152+
}
153+
}
154+
},
155+
"eventDeliverySchema": "EventGridSchema"
156+
}
157+
}
158+
```
159+
69160
## Next steps
70161
See the [Event handlers](event-handlers.md) article for a list of supported event handlers.

articles/event-grid/handler-storage-queues.md

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,120 @@ See the following tutorial for an example of using Queue storage as an event han
2222
|---------|---------|
2323
| [Quickstart: route custom events to Azure Queue storage with Azure CLI and Event Grid](custom-event-to-queue-storage.md) | Describes how to send custom events to a Queue storage. |
2424

25+
## REST examples (for PUT)
26+
27+
### Storage queue as the event handler
28+
29+
```json
30+
{
31+
"properties":
32+
{
33+
"destination":
34+
{
35+
"endpointType": "StorageQueue",
36+
"properties":
37+
{
38+
"resourceId": "/subscriptions/<AZURE SUBSCRIPTION ID>/resourceGroups/<RESOURCE GROUP NAME>/providers/Microsoft.Storage/storageAccounts/<STORAGE ACCOUNT NAME>",
39+
"queueName": "<QUEUE NAME>"
40+
}
41+
},
42+
"eventDeliverySchema": "EventGridSchema"
43+
}
44+
}
45+
```
46+
47+
### Storage queue as the event handler - delivery with managed identity
48+
49+
```json
50+
{
51+
"properties":
52+
{
53+
"deliveryWithResourceIdentity":
54+
{
55+
"identity":
56+
{
57+
"type": "SystemAssigned"
58+
},
59+
"destination":
60+
{
61+
"endpointType": "StorageQueue",
62+
"properties":
63+
{
64+
"resourceId": "/subscriptions/<AZURE SUBSCRIPTION ID>/resourceGroups/<RESOURCE GROUP NAME>/providers/Microsoft.Storage/storageAccounts/<STORAGE ACCOUNT NAME>",
65+
"queueName": "<QUEUE NAME>"
66+
}
67+
}
68+
},
69+
"eventDeliverySchema": "EventGridSchema"
70+
}
71+
}
72+
```
73+
74+
### Storage queue as a deadletter destination
75+
76+
```json
77+
{
78+
"name": "",
79+
"properties":
80+
{
81+
"destination":
82+
{
83+
"endpointType": "StorageQueue",
84+
"properties":
85+
{
86+
"resourceId": "/subscriptions/<AZURE SUBSCRIPTION ID>/resourceGroups/<RESOURCE GROUP NAME>/providers/Microsoft.Storage/storageAccounts/<DESTINATION STORAGE>",
87+
"queueName": "queue1"
88+
}
89+
},
90+
"eventDeliverySchema": "EventGridSchema",
91+
"deadLetterDestination":
92+
{
93+
"endpointType": "StorageBlob",
94+
"properties":
95+
{
96+
"resourceId": "/subscriptions/<AZURE SUBSCRIPTION ID>/resourceGroups/<RESOURCE GROUP NAME>/providers/Microsoft.Storage/storageAccounts/<DEADLETTER STORAGE>",
97+
"blobContainerName": "test"
98+
}
99+
}
100+
}
101+
}
102+
```
103+
104+
### Storage queue as a deadletter destination - managed identity
105+
106+
```json
107+
{
108+
"properties":
109+
{
110+
"destination":
111+
{
112+
"endpointType": "StorageQueue",
113+
"properties":
114+
{
115+
"resourceId": "/subscriptions/<AZURE SUBSCRIPTION ID>/resourceGroups/<RESOURCE GROUP NAME>/providers/Microsoft.Storage/storageAccounts/<DESTINATION STORAGE>",
116+
"queueName": "queue1"
117+
}
118+
},
119+
"eventDeliverySchema": "EventGridSchema",
120+
"deadLetterWithResourceIdentity":
121+
{
122+
"identity":
123+
{
124+
"type": "SystemAssigned"
125+
},
126+
"deadLetterDestination":
127+
{
128+
"endpointType": "StorageBlob",
129+
"properties":
130+
{
131+
"resourceId": "/subscriptions/<AZURE SUBSCRIPTION ID>/resourceGroups/<RESOURCE GROUP NAME>/providers/Microsoft.Storage/storageAccounts/<DEADLETTER STORAGE>",
132+
"blobContainerName": "test"
133+
}
134+
}
135+
}
136+
}
137+
}
138+
```
139+
25140
## Next steps
26141
See the [Event handlers](event-handlers.md) article for a list of supported event handlers.

articles/event-grid/handler-webhooks.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,26 @@ Use **Logic Apps** to implement business processes to process Event Grid events.
4444
| [Tutorial: Send email notifications about Azure IoT Hub events using Logic Apps](publish-iot-hub-events-to-logic-apps.md) | A logic app sends a notification email every time a device is added to your IoT hub. |
4545
| [Tutorial: Respond to Azure Service Bus events received via Azure Event Grid by using Azure Functions and Azure Logic Apps](../service-bus-messaging/service-bus-to-event-grid-integration-example.md?toc=%2fazure%2fevent-grid%2ftoc.json) | Event Grid sends messages from Service Bus topic to function app and logic app. |
4646

47+
## REST example (for PUT)
48+
49+
```json
50+
{
51+
"properties":
52+
{
53+
"destination":
54+
{
55+
"endpointType": "WebHook",
56+
"properties":
57+
{
58+
"endpointUrl": "<WEB HOOK URL>",
59+
"maxEventsPerBatch": 1,
60+
"preferredBatchSizeInKilobytes": 64
61+
}
62+
},
63+
"eventDeliverySchema": "EventGridSchema"
64+
}
65+
}
66+
```
67+
4768
## Next steps
4869
See the [Event handlers](event-handlers.md) article for a list of supported event handlers.

0 commit comments

Comments
 (0)