Hello @Derek,
In a local or Docker environment, the Event Grid URL for Azure Functions will be:
http://localhost:7071/runtime/webhooks/EventGrid?functionName={functionname}
There will be no key or code until the function is deployed to Azure. After deployment, the Event Grid URL/Azure Functions webhook URL will be:
https://FunctionAppName.azurewebsites.net/runtime/webhooks/EventGrid?functionName=EventGridTrigger1&code=3
Refer to this documentation for Azure Functions on Kubernetes with KEDA.
Testing Locally / On Docker:
I tested a sample Azure Function using Python with an EventGridTrigger named EventGridTrigger1
.
Steps to Test Using Postman
- Open Postman and set the method to POST.
- Enter the URL:
http://localhost:7071/runtime/webhooks/EventGrid?functionName=EventGridTrigger1
- Go to the Headers tab and add:
-
Content-Type: application/json
-
aeg-event-type: Notification
-
- Go to the Body tab, select raw, and paste the following JSON:
[
{
"id": "1234",
"eventType": "recordInserted",
"subject": "/myapp/orders",
"eventTime": "2024-02-26T10:00:00Z",
"data": {
"orderId": "5678",
"status": "created"
},
"dataVersion": "1.0"
}
]
Connecting Storage Account Events to the Function App
After deploying to Azure, you need to connect Storage Account Events to the Function App.
Refer to this documentation to learn how to push Blob Storage Events to an Azure Storage Table using an Azure Function App.
Event Grid Trigger Behavior
The EventGridTrigger is triggered only for the Event Types selected.
For example, if a blob is uploaded to Azure Storage, the corresponding events are sent to the Azure Function Endpoint. The EventGridTrigger is triggered only when changes occur within the selected event types.
Hope this helps!
If you found this answer helpful, please click Accept Answer and kindly upvote it.
If you have any further questions, please click Comment.