Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VSTS Release - Delete Azure BLOB Container / Contents

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.

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

like image 200
Thomas Avatar asked Aug 31 '18 13:08

Thomas


1 Answers

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

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>

enter image description here

like image 94
Jayendran Avatar answered Nov 15 '22 14:11

Jayendran