Přeskočit na hlavní obsah

Příspěvky

Zobrazují se příspěvky z září, 2016

Clean-up blobs in Azure storage account with Azure CLI

If you realize at some point of your bright Azure future you don't remove VM disks correctly (like me in JCLOUDS-1170) you'll probably want to do a storage account clean up. Here is, how I did it on my linux desktop using Azure CLI.
As I wanted to keep some private OS images which were located in the storage account too, I moved them first into a newly created storage container.
# Prerequisities installed azure-cli (I personally use the latest docker image microsoft/azure-cli with the tool) installed jq tool for parsing JSON # Set upSTORAGE_ACCOUNT="PutYourStorageAccountNameHere" STORAGE_KEY="PutYourStorageAccountAccessKeyHere" # Move/backup OS images to a new container# create new storage container for OS image blobs azure storage container create -a $STORAGE_ACCOUNT -k "$STORAGE_KEY" os-images
# linux images to be kept for IMG in eap-7-rhel-7.2 eap-7-rhel-7.2-service; do ORIG_BLOB=$(azure vm image show --json $IMG | jq -Mr '.mediaLinkUri') echo &qu…