Skip to content

Commit ffa288d

Browse files
Merge pull request #285918 from spelluru/egridcloudevents0830
Moved Cloud Events up
2 parents c600f74 + adc63de commit ffa288d

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

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

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ 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+
1418
## Endpoint validation with Event Grid events
1519
When you use any of the following three Azure services, the Azure infrastructure automatically handles this validation:
1620

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

2327
- **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.
2428

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.
29+
- **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.
2630

2731
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.
2832

@@ -42,7 +46,7 @@ If you're using any other type of endpoint, such as an HTTP trigger based Azure
4246
- The `data` property of the event includes a `validationCode` property with a randomly generated string. For example, `validationCode: acb13…`.
4347
- The event data also includes a `validationUrl` property with a URL for manually validating the subscription.
4448
- 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.
49+
- The Event Grid data plane SDKs have classes corresponding to the subscription validation event data and subscription validation response.
4650

4751
An example SubscriptionValidationEvent is shown in the following example:
4852

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

7579
And, follow one of these steps:
7680

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.
81+
- 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.
7882

7983
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.
8084

@@ -87,9 +91,6 @@ And, follow one of these steps:
8791

8892
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).
8993

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-
9394
## Event schema compatibility
9495
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.
9596

@@ -105,5 +106,6 @@ When a topic is created, an incoming event schema is defined. And, when a subscr
105106
| | Cloud Events v1.0 schema | Yes |
106107
| | Custom input schema | Yes |
107108

109+
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)