一旦触发Azure函数Blob输入绑定,便无法删除该Blob [英] Cannot delete the a blob once it triggers an Azure Function Blob Input Binding

查看:77
本文介绍了一旦触发Azure函数Blob输入绑定,便无法删除该Blob的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello

这是该问题的后续问题:

This is a follow-up question to this question:

How to delete a blob using Azure Functions?

当Blob触发我的Azure函数时,一旦完成处理,我需要将其删除.否则,我最终将在容器中出现许多斑点.

When a blob triggers my Azure Function, I need to delete it once its processing is done. Otherwise, I will end up with many blobs in the container.

当我运行以下代码时:

When I run the following code:

var container = blobClient.GetContainerReference(containerName);
var blockBlob = container.GetBlockBlobReference(fileName);
bool deleted = blockBlob.DeleteIfExists();

blockBlob.DeleteIfExists() 始终 返回false,并且永远不会删除该blob.

the method blockBlob.DeleteIfExists() always returns false and it never deletes the blob.

我的猜测是,由于blob刚刚触发了它,因此它以某种方式被函数执行锁定.

My guess is that the blob is somehow locked by the function execution since it just triggered it.

推荐答案

请问如何确保关闭所有流(如果在您的函数中使用),然后再删除blob.因此该图片已不再使用.
Could you please make sure that your close all streams (if you are using in your function) before you deleting your blob.So the image is no longer in use.


这篇关于一旦触发Azure函数Blob输入绑定,便无法删除该Blob的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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