Skip to content

Commit b037b25

Browse files
committed
Moved Cloud Events up
1 parent 2930730 commit b037b25

File tree

1 file changed

+22
-20
lines changed

1 file changed

+22
-20
lines changed

articles/event-grid/webhook-event-delivery.md

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,25 @@ Webhooks are one of the many ways to receive events from Azure Event Grid. When
1111

1212
Like many other services that support webhooks, Event Grid requires you to prove ownership of your Webhook endpoint before it starts delivering events to that endpoint. This requirement prevents a malicious user from flooding your endpoint with events.
1313

14+
15+
## Endpoint validation with CloudEvents v1.0
16+
CloudEvents v1.0 implements its own abuse protection semantics using the **HTTP OPTIONS** method. You can read more about it [here](https://github.com/cloudevents/spec/blob/v1.0/http-webhook.md#4-abuse-protection). When you use the CloudEvents schema for output, Event Grid uses the CloudEvents v1.0 abuse protection in place of the Event Grid validation event mechanism.
17+
18+
## Event schema compatibility
19+
When a topic is created, an incoming event schema is defined. And, when a subscription is created, an outgoing event schema is defined. The following table shows you the compatibility allowed when creating a subscription.
20+
21+
| Incoming event schema | Outgoing event schema | Supported |
22+
| ---- | ---- | ---- |
23+
| Event Grid schema | Event Grid schema | Yes |
24+
| | Cloud Events v1.0 schema | Yes |
25+
| | Custom input schema | No |
26+
| Cloud Events v1.0 schema | Event Grid schema | No |
27+
| | Cloud Events v1.0 schema | Yes |
28+
| | Custom input schema | No |
29+
| Custom input schema | Event Grid schema | Yes |
30+
| | Cloud Events v1.0 schema | Yes |
31+
| | Custom input schema | Yes |
32+
1433
## Endpoint validation with Event Grid events
1534
When you use any of the following three Azure services, the Azure infrastructure automatically handles this validation:
1635

@@ -22,7 +41,7 @@ If you're using any other type of endpoint, such as an HTTP trigger based Azure
2241

2342
- **Synchronous handshake**: At the time of event subscription creation, Event Grid sends a subscription validation event to your endpoint. The schema of this event is similar to any other Event Grid event. The data portion of this event includes a `validationCode` property. Your application verifies that the validation request is for an expected event subscription, and returns the validation code in the response synchronously. This handshake mechanism is supported in all Event Grid versions.
2443

25-
- **Asynchronous handshake**: In certain cases, you can't return the `validationCode` in response synchronously. For example, if you use a third-party service (like [`Zapier`](https://zapier.com) or [IFTTT](https://ifttt.com/)), you can't programmatically respond with the validation code.
44+
- **Asynchronous handshake**: In certain cases, you can't return the `validationCode` in response synchronously. For example, if you use a non-Microsoft service (like [`Zapier`](https://zapier.com) or [IFTTT](https://ifttt.com/)), you can't programmatically respond with the validation code.
2645

2746
Event Grid supports a manual validation handshake. If you're creating an event subscription with an SDK or tool that uses API version 2018-05-01-preview or later, Event Grid sends a `validationUrl` property in the data portion of the subscription validation event. To complete the handshake, find that URL in the event data and do a GET request to it. You can use either a REST client or your web browser.
2847

@@ -42,7 +61,7 @@ If you're using any other type of endpoint, such as an HTTP trigger based Azure
4261
- The `data` property of the event includes a `validationCode` property with a randomly generated string. For example, `validationCode: acb13…`.
4362
- The event data also includes a `validationUrl` property with a URL for manually validating the subscription.
4463
- The array contains only the validation event. Other events are sent in a separate request after you echo back the validation code.
45-
- The EventGrid data plane SDKs have classes corresponding to the subscription validation event data and subscription validation response.
64+
- The Event Grid data plane SDKs have classes corresponding to the subscription validation event data and subscription validation response.
4665

4766
An example SubscriptionValidationEvent is shown in the following example:
4867

@@ -74,7 +93,7 @@ To prove endpoint ownership, echo back the validation code in the `validationRes
7493

7594
And, follow one of these steps:
7695

77-
- You must return an **HTTP 200 OK** response status code. **HTTP 202 Accepted** isn't recognized as a valid Event Grid subscription validation response. The HTTP request must complete within 30 seconds. If the operation doesn't finish within 30 seconds, then the operation will be canceled and it may be reattempted after 5 seconds. If all the attempts fail, then it's treated as validation handshake error.
96+
- You must return an **HTTP 200 OK** response status code. **HTTP 202 Accepted** isn't recognized as a valid Event Grid subscription validation response. The HTTP request must complete within 30 seconds. If the operation doesn't finish within 30 seconds, then the operation will be canceled and it's reattempted after 5 seconds. If all the attempts fail, then it's treated as validation handshake error.
7897

7998
The fact that your application is prepared to handle and return the validation code indicates that you created the event subscription and expected to receive the event. Imagine the scenario that there's no handshake validation supported and a hacker gets to know your application URL. The hacker can create a topic and an event subscription with your application's URL, and start conducting a DoS attack to your application by sending a lot of events. The handshake validation prevents that to happen.
8099

@@ -87,23 +106,6 @@ And, follow one of these steps:
87106

88107
For an example of handling the subscription validation handshake, see a [C# sample](https://github.com/Azure-Samples/event-grid-dotnet-publish-consume-events/blob/master/EventGridConsumer/EventGridConsumer/Function1.cs).
89108

90-
## Endpoint validation with CloudEvents v1.0
91-
CloudEvents v1.0 implements its own abuse protection semantics using the **HTTP OPTIONS** method. You can read more about it [here](https://github.com/cloudevents/spec/blob/v1.0/http-webhook.md#4-abuse-protection). When you use the CloudEvents schema for output, Event Grid uses the CloudEvents v1.0 abuse protection in place of the Event Grid validation event mechanism.
92-
93-
## Event schema compatibility
94-
When a topic is created, an incoming event schema is defined. And, when a subscription is created, an outgoing event schema is defined. The following table shows you the compatibility allowed when creating a subscription.
95-
96-
| Incoming event schema | Outgoing event schema | Supported |
97-
| ---- | ---- | ---- |
98-
| Event Grid schema | Event Grid schema | Yes |
99-
| | Cloud Events v1.0 schema | Yes |
100-
| | Custom input schema | No |
101-
| Cloud Events v1.0 schema | Event Grid schema | No |
102-
| | Cloud Events v1.0 schema | Yes |
103-
| | Custom input schema | No |
104-
| Custom input schema | Event Grid schema | Yes |
105-
| | Cloud Events v1.0 schema | Yes |
106-
| | Custom input schema | Yes |
107109

108110
## Next steps
109111
See the following article to learn how to troubleshoot event subscription validations: [Troubleshoot event subscription validations](troubleshoot-subscription-validation.md).

0 commit comments

Comments
 (0)