【发布时间】:2020-04-09 09:34:38
【问题描述】:
我正在尝试使用 deleteBlobIfExists() npm 包中的 deleteBlobIfExists() 函数从私有 blob 容器中删除 blob。但是,当函数执行时,result 总是返回为false,这意味着 blob“不存在”。但是这个blob确实存在。我只是假设它找不到 blob,因为容器的访问权限设置为“私有”。帮忙?
const blobService = azure.createBlobService();
blobService.deleteBlobIfExists("my-blob-container", "my-blob", (err, result) => {
if(err) {
console.log(err);
}
});
【问题讨论】:
-
你确定你使用
azure.createBlobService()的连接选项是正确的,你为什么不尝试使用相同的BlobService查询my-blob。 -
如果你的容器的访问级别是私有的,请使用
azure.createBlobService(<connection string>)创建blob服务。更多详情请参考azure.github.io/azure-storage-node/global.html
标签: node.js azure azure-blob-storage