Skip to content

Instantly share code, notes, and snippets.

@bangonkali
Created October 22, 2020 05:20
Show Gist options
  • Save bangonkali/d87b3750568950c3b28d7a2f35f57ee9 to your computer and use it in GitHub Desktop.
Save bangonkali/d87b3750568950c3b28d7a2f35f57ee9 to your computer and use it in GitHub Desktop.
Azure Container Notes

Download all files in a container

az login
az account set --subscription "subscription_id"
az storage blob download-batch -d . \
  --pattern "*.*" \
  -s "container_name" \
  --account-name "storage_account_name" \
  --connection-string "conntection_string"

Change the Tier (Hot, Cold, Archive) of all blobs in a container

$StgAcc = "storage_account_name"
$StgKey = "storage_account_key"
$Container = "container_name"
$Tier = "Hot" 
$ctx = New-AzureStorageContext -StorageAccountName $StgAcc -StorageAccountKey $StgKey
Connect-AzureRmAccount

$blob = Get-AzureStorageBlob -Container $Container -Context $ctx
$blob.icloudblob.setstandardblobtier($Tier)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment