从 Azure 门户删除 Blob 文件

Delete Blob file from the Azure Portal

我是 Azure DatabaseDB 新手,我想检查上传到 blob 存储的文件,并从 portal.azure.com.

中一一删除

是否可以查看列表并将其从 portal.azure.com 中删除?

Note: I just want to delete the files stored in the blob storage, not the blob storage.

我找到了解决方案。

点击你的 Storage Account -> 点击 Containers => Select Container => 点击 File => 最后 Delete

=============================================

更新:

Azure Storage Explorer 也提供相同的功能。免费工具,可在 Windows、macOS 或 Linux

的任何地方轻松管理您的 Azure 云存储资源

上传、下载和管理 Azure blob、文件、队列和表,以及 Azure Cosmos DB 和 Azure Data Lake Storage 实体。轻松访问虚拟机磁盘并使用 Azure 资源管理器或经典存储帐户。管理和配置 cross-origin 资源共享规则。

谢谢。

您也可以通过 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");
}