Event grid not triggering function for blobs created by SFTP

Willie 0 Reputation points
2024-04-17T17:55:37.0566667+00:00

I use azure event grid to trigger our azure function app whenever a blob is created. When we receive it via sftp the event doesn't trigger the function, however if I download that same file and upload it via the portal, it triggers. When I look at the properties of the two files, look like the blobs that are added via sftp have a CONTENT-TYPE of application/octet-stream and the blobs that are manually uploaded have a CONTENT-TYPE of application/vnd.openxmlformats-officedocument.spreadsheetml.sheet. How can I resolve this where it triggers no matter what

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,275 questions
Azure Event Grid
Azure Event Grid
An Azure event routing service designed for high availability, consistent performance, and dynamic scale.
316 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. MayankBargali-MSFT 68,631 Reputation points
    2024-04-18T07:08:43.64+00:00

    @Willie Thanks for reaching out. Can you please confirm if you have specified any filter at your event grid subscription which is dropping the events?

    As per Azure Blob Storage as an Event Grid source document both will have the Microsoft.Storage.BlobCreated event but there would be property difference as documented.

    If you are adding any filter at the event grid subscription, then the events may be dropped as per your condition. Please review if this is not the case for your issue?

    To answer below:

    look like the blobs that are added via sftp have a CONTENT-TYPE of application/octet-stream and the blobs that are manually uploaded have a CONTENT-TYPE of application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

    Yes contentType key is set to application/octet-stream with some other property changes as documented here. There is no option to change this property.
    You need to review your event grid filter not to drop these events in case if you have specified any.

    0 comments No comments