It appears that there are some differences in the way blob events are triggered when using SFTP compared to other methods like uploading files through the portal. To troubleshoot this issue, you can try the following steps:
Enable Storage Diagnostic logs: Enable diagnostic logging for your storage account to capture detailed information about the blob events. This will help you verify if the blob receipts are received properly when files are uploaded via SFTP. You can refer to the Azure documentation on enabling diagnostic logs for Azure Storage.
Validate SFTP blob receipts: Check the diagnostic logs to ensure that the blob events are being captured and received properly when files are uploaded via SFTP. Verify if the events are triggering the Azure Function as expected. This will help identify if the issue lies in the event triggering mechanism.
Consider using EventGrid: Instead of relying solely on the blob trigger, you can set up an EventGrid subscription for the storage account and filter specifically for the SftpCommit event. This ensures that your Azure Function is triggered reliably when an SFTP file is committed to the container. You can refer to the Azure documentation on triggering Azure Functions on blob containers using an event subscription for more information.
By following these steps, you should be able to gather more information about the events triggered by SFTP uploads and ensure that your Azure Function is properly triggered when files are uploaded via WinSCP with SFTP.