VSTS版本-删除Azure BLOB容器/内容 [英] VSTS Release - Delete Azure BLOB Container / Contents

查看:60
本文介绍了VSTS版本-删除Azure BLOB容器/内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用VSTS,利用新的静态网站功能将Angular应用程序部署到Blob存储.为此,我使用了 Azure File Copy 任务.由于Angular会在每个版本中为不同的包创建新的文件名,因此我不能只覆盖旧文件,因此最终会有很多旧& $ web 容器中的未使用文件.

I'm using VSTS to deploy an Angular app to blob storage making use of the new static website feature. For this I'm using the Azure File Copy task. Since Angular will create new filenames for the different bundles on every build I can't just overwrite the old files, so eventually there will be a lot of old & unsused files in that $web container.

不幸的是,我没有找到合适的任务来做到这一点.

Unfortunately I haven't found a suitable task to do that.

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

How can I delete or clear out this container in VSTS using the release pipeline before redeploying?

推荐答案

Azure File Copy在内部使用 AzCopy ,因此无法使用 Azure File Copy删除/清理容器

Azure File Copy is internally using AzCopy so it's is not possible to delete/clean up the container using Azure File Copy

您可以在运行 Azure File Copy 任务 Azure CLI 任务调用 az cmdlet 清理容器.>

You can use Azure CLI task to invoke the az cmdlets to clean up your container before running the Azure File Copy task

az storage blob delete-batch --account-name <storage_account_name> --source <container_name>

这篇关于VSTS版本-删除Azure BLOB容器/内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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