Advertisement
Guest User

Untitled

a guest
Oct 21st, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. #!/bin/bash
  2. # This script changes the access tier to "Archive" for all blobs in a folder on a Microsoft Azure storage account
  3. #
  4.  
  5. blobs=($(az storage blob list --num-results "*" --account-name <account_name> -c <container_name> | grep -E '"name": "path/to/folder' | sed -n -e 's/\"name\": \"//p' | sed -n -e 's/\",//p'))
  6.  
  7. length=${#blobs[@]}
  8.  
  9. for ((i = 0; i != length; i++)); do
  10. echo "Changing access tier to Archive for: ${blobs[i]}"
  11. az storage blob set-tier --account-name <account_name> -c <container_name> -n ${blobs[i]} --tier Archive
  12. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement