VSTS 版本 - 删除 Azure BLOB 容器/内容

VSTS Release - Delete Azure BLOB Container / Contents

我正在使用 VSTS 将 Angular 应用程序部署到 blob 存储,利用新的静态网站功能。为此,我使用 Azure File Copy 任务。 由于 Angular 会在每次构建时为不同的包创建新的文件名,我不能只覆盖旧文件,所以最终 $web 容器中会有很多旧的和未使用的文件。

很遗憾,我还没有找到合适的任务。

如何在重新部署之前使用发布管道在 VSTS 中删除或清除此容器?

Azure 文件复制在内部使用 AzCopy,因此无法使用 Azure File Copy

delete/clean 启动容器

您可以使用 Azure CLI 任务调用 az cmdlets 以在 运行 Azure File Copy 任务

之前清理您的容器
az storage blob delete-batch --account-name <storage_account_name> --source <container_name>