【发布时间】:2023-03-06 10:31:02
【问题描述】:
我是 Azure DatabaseDB 的新手,我想检查上传到 blob 存储的文件,并从 portal.azure.com 中一一删除。
是否可以查看列表并将其从 portal.azure.com 中删除?
注意:我只是想删除存储在 blob 存储中的文件,而不是 Blob 存储。
【问题讨论】:
标签: azure azure-storage azure-blob-storage blobstorage
我是 Azure DatabaseDB 的新手,我想检查上传到 blob 存储的文件,并从 portal.azure.com 中一一删除。
是否可以查看列表并将其从 portal.azure.com 中删除?
注意:我只是想删除存储在 blob 存储中的文件,而不是 Blob 存储。
【问题讨论】:
标签: azure azure-storage azure-blob-storage blobstorage
你也可以从你的 C# 代码中做到这一点-
private CloudBlobContainer blobContainer;
public void DeleteFile(string uniqueFileIdentifier)
{
this.AssertBlobContainer();
var blob = this.blobContainer.GetBlockBlobReference(fileName);
blob.DeleteIfExists();
}
private void AssertBlobContainer()
{
// only do once
if (this.blobContainer == null)
{
lock (this.blobContainerLockObj)
{
if (this.blobContainer == null)
{
var client = this.cloudStorageAccount.CreateCloudBlobClient();
this.blobContainer = client.GetContainerReference(this.containerName.ToLowerInvariant());
if (!this.blobContainer.Exists())
{
throw new CustomRuntimeException("Container {0} does not exist in azure account", containerName);
}
}
}
}
if (this.blobContainer == null) throw new NullReferenceException("Blob Empty");
}
【讨论】:
我找到了解决方案。
点击你的Storage Account -> 点击Containers => 选择Container => 点击File => 最后Delete
==============================================
更新:
Azure Storage Explorer 也提供相同的功能。从 Windows、macOS 或 Linux 随时随地轻松管理 Azure 云存储资源的免费工具
上传、下载和管理 Azure Blob、文件、队列和表,以及 Azure Cosmos DB 和 Azure Data Lake Storage 实体。轻松访问虚拟机磁盘并使用 Azure 资源管理器或经典存储帐户。管理和配置跨域资源共享规则。
谢谢。
【讨论】:
upvote it ;)