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/end-point-validation-event-grid-events-schema.md
+21-18Lines changed: 21 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,17 +1,20 @@
1
1
---
2
-
title: Endpoint validation with Event Grid event schema
2
+
title: Validate Webhook Endpoints with Event Grid Schema
3
3
description: This article describes WebHook event delivery and endpoint validation when using webhooks and the Event Grid event schema.
4
4
ms.topic: concept-article
5
-
ms.date: 09/25/2024
5
+
ms.date: 03/27/2026
6
+
author: spelluru
7
+
ms.author: spelluru
8
+
ms.reviewer: spelluru
6
9
ms.custom: FY25Q1-Linter
7
10
#customer intent: As a developer, I want to know how to validate a Webhook endpoint using the Event Grid event schema.
8
11
---
9
12
10
13
11
14
# Endpoint validation with Event Grid event schema
12
-
Webhooks are one of the many ways to receive events from Azure Event Grid. When a new event is ready, Event Grid service POSTs an HTTP request to the configured endpoint with the event information in the request body.
15
+
Webhooks are one of the many ways to receive events from Azure Event Grid. When a new event is ready, the Event Grid service POSTs an HTTP request to the configured endpoint with the event information in the request body.
13
16
14
-
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.
17
+
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.
15
18
16
19
## Endpoint validation with Event Grid events
17
20
When you use any of the following three Azure services, the Azure infrastructure automatically handles this validation:
@@ -37,16 +40,16 @@ If you're using any other type of endpoint, such as an HTTP trigger based Azure
37
40
38
41
### Validation details
39
42
40
-
-At the time of event subscription creation/update, Event Grid posts a subscription validation event to the target endpoint.
41
-
- The event contains a header value `aeg-event-type: SubscriptionValidation`.
42
-
- The event body has the same schema as other Event Grid events.
43
+
-When you create or update an event subscription, Event Grid sends a subscription validation event to the target endpoint.
44
+
- The event includes a header with the value `aeg-event-type: SubscriptionValidation`.
45
+
- The event body follows the same schema as other Event Grid events.
43
46
- The `eventType` property of the event is `Microsoft.EventGrid.SubscriptionValidationEvent`.
44
-
- The `data` property of the event includes a `validationCode` property with a randomly generated string. For example, `validationCode: acb13…`.
47
+
- The `data` property of the event contains a `validationCode` property with a randomly generated string. For example, `validationCode: acb13…`.
45
48
- The event data also includes a `validationUrl` property with a URL for manually validating the subscription.
46
49
- The array contains only the validation event. Other events are sent in a separate request after you echo back the validation code.
47
-
- The Event Grid data plane SDKs have classes corresponding to the subscription validation event data and subscription validation response.
50
+
- The Event Grid data plane SDKs include classes that correspond to the subscription validation event data and subscription validation response.
48
51
49
-
An example SubscriptionValidationEvent is shown in the following example:
52
+
The following example shows a `SubscriptionValidationEvent`:
50
53
51
54
```json
52
55
[
@@ -74,21 +77,21 @@ To prove endpoint ownership, echo back the validation code in the `validationRes
74
77
}
75
78
```
76
79
77
-
And, follow one of these steps:
80
+
Follow one of these steps:
78
81
79
-
- 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.
82
+
- 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, the operation is canceled and reattempted after 5 seconds. If all the attempts fail, the operation is treated as a validation handshake error.
80
83
81
-
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.
84
+
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 where there's no handshake validation supported and a bad actor gets to know your application URL. The bad actor can create a topic and an event subscription with your application's URL, and start conducting a DoS attack on your application by sending many events. The handshake validation prevents that to happen.
82
85
83
-
Imagine that you already have the validation implemented in your app because you created your own event subscriptions. Even if a hacker creates an event subscription with your app URL, your correct implementation of the validation request event checks for the `aeg-subscription-name` header in the request to ascertain that it's an event subscription that you recognize.
86
+
Imagine that you already have the validation implemented in your app because you created your own event subscriptions. Even if a bad actor creates an event subscription with your app URL, your correct implementation of the validation request event checks for the `aeg-subscription-name` header in the request to ascertain that it's an event subscription that you recognize.
84
87
85
-
Even after that correct handshake implementation, a hacker can flood your app (it already validated the event subscription) by replicating a request that seems to be coming from Event Grid. To prevent that, you must secure your webhook with Microsoft Entra authentication. For more information, see [Deliver events to Microsoft Entra protected endpoints](secure-webhook-delivery.md).
86
-
- Or, you can manually validate the subscription by sending a GET request to the validation URL. The event subscription stays in a pending state until validated. The validation Url uses **port 553**. If your firewall rules block port 553, you need to update rules for a successful manual handshake.
88
+
Even after that correct handshake implementation, a bad actor can flood your app (it already validated the event subscription) by replicating a request that seems to be coming from Event Grid. To prevent that, you must secure your webhook with Microsoft Entra authentication. For more information, see [Deliver events to Microsoft Entra protected endpoints](secure-webhook-delivery.md).
89
+
- Or, you can manually validate the subscription by sending a GET request to the validation URL. The event subscription stays in a pending state until validated. The validation URL uses **port 553**. If your firewall rules block port 553, you need to update rules for a successful manual handshake.
87
90
88
-
In your validation of the subscription validation event, if you identify that it isn't an event subscription for which you're expecting events, you wouldn't return a 200 response or no response at all. Hence, the validation fails.
91
+
In your validation of the subscription validation event, if you identify that it isn't an event subscription for which you're expecting events, don't return a 200 response or return no response at all. Hence, the validation fails.
89
92
90
93
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).
91
94
92
95
93
96
## Related content
94
-
See the following article to learn how to troubleshoot event subscription validations:[Troubleshoot event subscription validations](troubleshoot-subscription-validation.md).
97
+
To learn how to troubleshoot event subscription validations, see[Troubleshoot event subscription validations](troubleshoot-subscription-validation.md).
Copy file name to clipboardExpand all lines: articles/event-grid/manage-event-delivery.md
+11-7Lines changed: 11 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,12 @@
1
1
---
2
-
title: Dead letter and retry policies - Azure Event Grid
3
-
description: Describes how to customize event delivery options for Event Grid. Set a dead-letter destination, and specify how long to retry delivery.
2
+
title: "Set Dead Letter Location and Retry Policy - Azure Event Grid"
3
+
description: "Learn how to set a dead letter location and customize retry policy settings for Azure Event Grid subscriptions. Configure event delivery options using Azure portal, CLI, or PowerShell."
4
+
#customer intent: As a developer, I want to set up a dead-letter location for my Event Grid subscription so that I can capture events that fail to deliver and troubleshoot delivery issues.
# Customer intent: As a developer, I want to know how to set a dead-letter location and a retry policy.
@@ -27,11 +31,11 @@ While creating an event subscription, you can enable dead-lettering on the **Add
27
31
28
32
You can optionally enable a system-assigned or user-assigned managed identity for dead-lettering. The managed identity must be a member of a [role-based access control (RBAC) role](../storage/blobs/authorize-access-azure-active-directory.md#azure-built-in-roles-for-blobs) that allows writing events to the storage.
29
33
30
-
:::image type="content" source="./media/manage-event-delivery/dead-letter-configuration.png" alt-text="Screenshot showing the dead-letter configuration of an event subscription.":::
34
+
:::image type="content" source="./media/manage-event-delivery/dead-letter-configuration.png" alt-text="Screenshot of the dead-letter configuration settings on the Additional features tab when creating an Event Grid subscription.":::
31
35
32
36
You can also enable dead-lettering and configure the settings for an existing event subscription. On the **Event Subscription** page of your event subscription, switch to the **Additional features** tab to see the dead-letter settings as shown in the following image.
33
37
34
-
:::image type="content" source="./media/manage-event-delivery/dead-letter-configuration-existing-subscription.png" alt-text="Screenshot showing the dead-letter configuration of an existing event subscription.":::
38
+
:::image type="content" source="./media/manage-event-delivery/dead-letter-configuration-existing-subscription.png" alt-text="Screenshot of the dead-letter settings on the Additional features tab for an existing Event Grid event subscription.":::
35
39
36
40
37
41
### Azure CLI
@@ -84,11 +88,11 @@ You can't configure the [retry schedule](delivery-and-retry.md#retry-schedule).
84
88
85
89
While creating an event subscription, you can configure retry policy settings on the **Additional features** tab.
86
90
87
-
:::image type="content" source="./media/manage-event-delivery/retry-policy-settings.png" alt-text="Screenshot showing the retry policy configuration of an event subscription.":::
91
+
:::image type="content" source="./media/manage-event-delivery/retry-policy-settings.png" alt-text="Screenshot of the retry policy configuration settings on the Additional features tab when creating an Event Grid subscription.":::
88
92
89
93
You can also configure retry policy settings for an existing event subscription. On the **Event Subscription** page of your event subscription, switch to the **Additional features** tab to see the retry policy settings as shown in the following image.
90
94
91
-
:::image type="content" source="./media/manage-event-delivery/retry-policy-settings-existing-subscription.png" alt-text="Screenshot showing the retry policy configuration of an existing event subscription.":::
95
+
:::image type="content" source="./media/manage-event-delivery/retry-policy-settings-existing-subscription.png" alt-text="Screenshot of the retry policy settings on the Additional features tab for an existing Event Grid event subscription.":::
0 commit comments