An unexpected isssue in EventGrid Callback validation requests
I did spend hours trying to figure out why Cloud Event Webhook validation was ok in one service and failed in other services in Azure.
I was running the exactly the same App as a App Service and Container App.
I found out that the problem was that the request header names have different casings.
WebHook-Request-Callback:
vs.
webhook-request-callback:
I wish they could atleast be consistent within Azure and EventGrid..
Here's a webhook-request-callback to an App Service
OPTIONS /hook2
CLIENT-IP: 51.12.47.159:64196
DISGUISED-HOST: as-clouddebugger-linux-container.azurewebsites.net
Host: as-clouddebugger-linux-container.azurewebsites.net
Max-Forwards: 10
WAS-DEFAULT-HOSTNAME: as-clouddebugger-linux-container.azurewebsites.net
WebHook-Request-Callback: https://rp-swedencentral.eventgrid.azure.net:553/eventsubscriptions/cloudevent-linux-container/validate?id=041F50B3-5A9F-417B-835D-1CDE58F3C6A9&t=2025-01-29T18:53:45.4115525Z&apiVersion=2024-12-15-preview&token=SZUYTGhOMExsrcg3qmStXMhsezj1TCILREWmZCQXVh4%3d
WebHook-Request-Origin: eventgrid.azure.net
X-ARR-LOG-ID: 32916421-23c7-4df7-8024-d1e0a42ea84b
X-ARR-SSL: 2048|256|CN=Microsoft Azure RSA TLS Issuing CA 08, O=Microsoft Corporation, C=US|CN=*.azurewebsites.net, O=Microsoft Corporation, L=Redmond, S=WA, C=US
X-AppService-Proto: https
X-Client-IP: 51.12.47.159
X-Client-Port: 64196
X-Forwarded-TlsVersion: 1.2
X-Original-For: [::ffff:169.254.131.1]:52719
X-Original-Proto: http
X-Original-URL: /hook2
X-SITE-DEPLOYMENT-ID: as-CloudDebugger-Linux-Container
X-WAWS-Unencoded-URL: /hook2
And here is a request to Container AppService-Proto
OPTIONS /hook2
Content-Length: 0
Host: ca-clouddebugger.orangewater-c2f516d4.swedencentral.azurecontainerapps.io
X-Original-For: [::ffff:100.100.0.180]:56784
X-Original-Proto: http
webhook-request-callback: https://rp-swedencentral.eventgrid.azure.net:553/eventsubscriptions/cloudevent-linux-container-app/validate?id=DDAD8472-2717-4624-8661-210F29029BB2&t=2025-01-29T18:57:11.1296364Z&apiVersion=2024-12-15-preview&token=%2fnvnFmnrE5MGmBCutflYlZTU1Ux9f7JakOtnRNyyYUQ%3d
webhook-request-origin: eventgrid.azure.net
x-arr-ssl: true
x-envoy-expected-rq-timeout-ms: 1800000
x-envoy-external-address: 51.12.47.151
x-k8se-app-kind: web
x-k8se-app-name: ca-clouddebugger--9bn4egg
x-k8se-app-namespace: k8se-apps
x-k8se-protocol: http1
x-ms-containerapp-name: ca-clouddebugger
x-ms-containerapp-revision-name: ca-clouddebugger--9bn4egg
x-request-id: 796c0195-690a-4aa8-95ba-705655383419