我们如何防止azure函数处理已经处理过的blob? [英] How can we prevent an azure function from processing already processed blob?

查看:77
本文介绍了我们如何防止azure函数处理已经处理过的blob?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个azure函数,该函数绑定到Blob存储.成功处理Blob之后,我用后缀'-Processed'重命名该文件.

I have an azure function, which is binded to blob storage. Once the blob is successfully processed I rename the file with a suffix '-Processed'.

但是我的azure函数再次拾取相同的blob进行处理.我尝试将{name} .csv过滤器放入BlobTrigger绑定中,但这没有帮助,因为即使重命名后该文件仍将是csv.

But my azure function again picks up the same blob for processing. I tried putting {name}.csv filter in the BlobTrigger binding but that didn't help as the file will still be a csv even after the rename.

我知道我可以过滤blob以在文件名中包含特定字符串,例如"original- {name}"将过滤以原始文件开头的文件. 但是,在azure函数中,有没有一种方法可以过滤blob名称以使其不包含特定字符串(在我的情况下为"-Processed")?

I know I can filter blobs to have a particular string in file name, for eg "original-{name}" will filter files starting with original. But Is there a way in azure functions using which I can filter the blob names to not include a particular string, in my case '-Processed'?

推荐答案

  1. 只需对已处理和未处理的blob使用两条不同的路径.
  2. 重命名删除前缀时,请使用前缀(例如"notprocessed-")放置新的blob.设置"path": "input/notprocessed-{name}"

这篇关于我们如何防止azure函数处理已经处理过的blob?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆