Azure 函数(C#):如何将大量文件从 blob 容器 A 复制到另一个 blob 容器 B?(函数在 10 分钟内超时) [英] Azure Function(C#): How to copy lots of files from blob container A to another blob container B? (Function has timeout in 10 mins)

查看:50
本文介绍了Azure 函数(C#):如何将大量文件从 blob 容器 A 复制到另一个 blob 容器 B?(函数在 10 分钟内超时)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

想使用 Azure Function 将大量文件从 blob 容器 A 复制到另一个 blob 容器 B.但是,由于函数超时,面临丢失复制文件的问题.有什么方法可以巧妙地恢复它吗?是否有关于源 blob 存储的任何指示,该存储标识之前已复制/处理过,以便下一个函数可以跳过复制?

Would like to use Azure Function to copy lots of files from blob container A to another blob container B. However, faced missing copying files due to Function timeout. Is there any method to resume it smartly? Is there any indication on source blob storage which identified copied/handled before so that next Function can skip copying that?

推荐答案

想使用 Azure Function 从 blob 复制大量文件容器 A 到另一个 blob 容器 B.但是,面临丢失由于函数超时而复制文件.

Would like to use Azure Function to copy lots of files from blob container A to another blob container B. However, faced missing copying files due to Function timeout.

您可以通过更改计划级别来避免此超时问题.例如,如果您使用应用服务计划并始终开启,则不再有超时限制.不过老实说,如果你的文件很多,而且需要很长时间,那么azure函数不是推荐的方法(函数执行的任务应该是轻量级的).

You can avoid this timeout problem by changing the plan level. For example, if you use the app service plan and turn on always on, there will be no more timeout restrictions. But to be honest, if you have a lot of files and it takes a long time, then azure function is not a recommended method (the task performed by the function should be lightweight).

是否有任何指示标识的源 blob 存储之前复制/处理过以便下一个函数可以跳过复制那个?

Is there any indication on source blob storage which identified copied/handled before so that next Function can skip copying that?

是的,当然可以.只需在复制后添加 blob 的自定义元数据.下次复制文件时,可以先查看自定义元数据.

Yes, of course you can. Just add the custom metadata of the blob after it was copied. When you copy files next time, you can first check the custom metadata.

这篇关于Azure 函数(C#):如何将大量文件从 blob 容器 A 复制到另一个 blob 容器 B?(函数在 10 分钟内超时)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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