The AEG doesn't handle a subscription webhook endpoint validation for custom topic endpoint, however there is a workaround for this missing feature, see more details here.
The concept of the AEG cascading is to subscribe for that custom topic and its subscriber will handle a validation via a http GET call.
I do recommend to create a custom topic endpoint with a CustomInputSchema otherwise the blob storage event will be nested in the event data object.
UPDATE:
The following is more details about the AEG-To-AEG integration such as a cascading (forwarding) a source events.
Note, that this integration (see below picture) is not full supported by current version of the AEG, in other words, the custom topic endpoint doesn't have built-in a validation response:
During the subscription handshaking with the webhook endpoint the following event message (example for blob storage) is sent to the endpoint:
[
{
"id": "c2ad3900-f483-4e45-a15b-927195878e99",
"topic": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myRG/providers/Microsoft.Storage/storageAccounts/myStorage",
"subject": "",
"data": {
"validationCode": "00000000-0000-0000-0000-000000000000",
"validationUrl": "https://rp2-westus.eventgrid.azure.net:553/eventsubscriptions/cascade/validate?id=04B6279C-A6ED-4FC0-981A-D9E53312B49A&t=2019-08-22T05:12:44.3114422Z&apiVersion=2019-02-01-preview&token=xxxxxxxxxxxxxx"
},
"eventType": "Microsoft.EventGrid.SubscriptionValidationEvent",
"eventTime": "2019-08-22T05:12:44.3114422Z",
"metadataVersion": "1",
"dataVersion": "2"
}
]
The event subscription is waiting for validation response either by programmatically (response with a validationCode) or manually (sending a GET request to validationUrl).
For this kind of integration we have to use a manually validation such as sending a GET request. For this purpose we have to create a subscriber to handle a manually validation on the custom topic.
The following picture shows this solution:
Implementation of the EventGridTrigger function for manually validation is described here.
As you can see the above event validation message, the subject property is empty, so we can handle this case and also the case of nested (cascading) an event data, the custom topic endpoint should be created with a CustomEventSchema.
The following is an example of the property object in the request payload:
"properties": {
"inputSchema": "CustomEventSchema",
"inputSchemaMapping": {
"properties": {
"id": {
"sourceField": null
},
"topic": {
"sourceField": null
},
"eventTime": {
"sourceField": null
},
"eventType": {
"sourceField": null,
"defaultValue": "notification"
},
"subject": {
"sourceField": null,
"defaultValue": "/webhook/events"
},
"dataVersion": {
"sourceField": null,
"defaultValue": "1.0"
}
},
"inputSchemaMappingType": "Json"
}
}
Notes:
- The custom topic aeg-sas-key value must be url encoded in the webhook endpoint address.
The advanced filter for validator can be used:
"advancedFilters": [
{
"values": [
"Microsoft.EventGrid.SubscriptionValidationEvent"
],
"operatorType": "StringContains",
"key": "Data.EventType"
}
]