I have an Azure Function triggered by EventGridEvents
.
function.json
set accordingly:
{
"scriptFile": "__init__.py",
"bindings": [{
"name": "event",
"type": "eventGridTrigger",
"direction": "in"
}]
}
__init__.py
dialed in (only snippet shown here):
def main(event: func.EventGridEvent):
result = json.dumps({
'id' : event.id,
'data' : event.get_json(),
'topic' : event.topic,
'subject' : event.subject,
'event_type' : event.event_type
})
- Function is successfully deployed
- EventGrid trigger created successfully
- I successfully published an
EventGrid
message here:
- But the Function never triggered.
I'd like to now see the actual EventGrid
message and debug why the Function didn't trigger, but I can't find a place to view the message!
I waited ~30mins, refeshed multiple times and was even watching the AppInsights live logs, no trigger.
- Where do I view an
EventGrid
message after its successfully published - How should I debug this Function?
EDIT 1:
Digging around for a while I found this other "metric" that shows 0 Delivered Events
How is an event "Published" but not "Delivered"?
I have done a test. On my side it seems no problem.
Maybe something different between yours and mine.
Please check:
_init_.py
function.json
And this is my eventgrid subscription:(I add a blob to the specific container and delete it. Please notice that the metric of the eventgrid subscription may take about 5 minutes to show. But it will trigger your endpoint function immediately.)
This is the filter of my eventgrid subscription:
I want the blob created and deleted in the test container to trigger the endpoint azure function, so I add
/blobServices/default/containers/test
to the 'Subject Begins With' section.Then my function works fine: