0

I have an azure function that is defined to use blob trigger and this works perfect when I upload a file from portal. As you can see in the signature the azure function should only trigger for xml file The account I use is defined like this Performance : Standard Replication : Locally-redundant storage (LRS) Account kind : StorageV2 (general prpose v2) Data Lake Storage Hierarchical namespace enabled

The azure function signature is defined like this public void Run( [BlobTrigger("input-xml/{name}.xml")] Stream inputBlob, IBinder binder, string name, ILogger log) {

The function is written in C#.NET The problem occur when a customer send an xml file using WinSCP with sftp. The azure function does not react at all when the file is written in the container input-xml. To be able to make my azure function to read the xml file I can restart the azure function. I can't understand the difference between drop a file by upload or use WinSCP with sftp. I mean as soon as an xml file is being located in the container input-xml the azure function should start to run. Target framework I use is .NET 5.0. According to the documentation it should work when you use StorageV2 (general prpose v2) and Data Lake Storage Gen2 Hierarchical namespace enabled and as you can see we have defined to use Account kind : StorageV2 (general prpose v2) Data Lake Storage Hierarchical namespace enabled

The xml file appear in the container input-xml but azure function ignore the file that should be processed. I have now downloaded WinSCP and use sftp and put an xml file into container input-xml but my azure function doesn't start and process the file. Do you have any suggestion how I can selve this problem. I must say it works sometimes. It must work every time.

Thanks in advance Tony Johansson

tony
  • 37
  • 5
  • Is it just "WinSCP"? Any SFTP upload? + So far this does not look like a [programming question](https://stackoverflow.com/help/on-topic), rather an Azure infrastructure issue. – Martin Prikryl May 26 '23 at 18:51

1 Answers1

1

I would never think that placing a blob in the container by any other means would be considered another type of event. But, apparently it is. From this past question, which actually was a problem triggering twice with SFTP, it seems.

When we upload a blob directly from the Azure portal, it would only create a single "PutBlob" event, when you use sftp protocol (no matter what software it is), it would create 2 events (sftpcreate and sftpcommit) right after the sftpconnect event.

Not sure if there is a built-in option to solve this for blob trigger, but maybe, instead of triggering with the blob itself, you can try using EventGrid as mentioned in that same question/response. And adding the filter for SftpCommit.


EDIT: Make sure to use StorageV2 to use Events.