Azure / azure-functions-eventgrid-extension

EventGrid extension for Azure Functions
MIT License
48 stars 32 forks source link

EventGrid to Azure Function #117

Closed roedinaranda closed 11 hours ago

roedinaranda commented 9 months ago

I have multiple event grids that are calling on the same azure function (python) to process the data when an event is received. I need to be able to determine from which azure event grid the event came from. Right now using the function below

logging.info('Python EventGrid trigger processed an event')

result = json.dumps({
    'id': event.id,
    'data': event.get_json(),
    'topic': event.topic,
    'subject': event.subject,
    'event_type': event.event_type,
})

logging.info('Python EventGrid trigger processed an event: %s', result)

the results only contain

Python EventGrid trigger processed an event: {"id": "9002023100607253115026600000000000000xxxxxxxxxxxxxxxxxxxxxx", "data": {"some json data"}, "topic": null, "subject": null, "event_type": null}

i would like to specify a topic or subject per event grid event. Any suggestions how?

Thank you