I have an Azure Function triggered by Event Grid Events. Event Grid Events are created only when a blob is uploaded to a Storage Account.
This is now deployed and working well although for some reason, the Function keeps getting triggered by the same event even though it successfully processed?
Example:
Today I review the logs, and the function has continued to execute!
Error: "Blob does not exist"
I deleted the blob after last test yesterday. Why is the Event Grid still firing?
Code snippet:
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
})
logging.info('EventGrid trigger processing an event: %s', result)
credential = DefaultAzureCredential()
download_start_time = datetime.datetime.now()
logging.info(f'######## Starting downloading blob from storage at ' + str(download_start_time) + ' ########')
# =============================
# Download blob from storage container:
# =============================
blob_client = BlobClient.from_blob_url(event.get_json()["url"], credential)
blob_data = blob_client.download_blob().readall()
blob_byte_stream = io.BytesIO(blob_data)
EDIT 1: This is still happening, this time a bit different.
- Now, the EventGrid keeps firing after SUCCESSFULLY passing messages and the Function running
How do I debug this?