Listing only Archive blobs using Az CLI
I had workaround in my environment using the same command
az storage blob list --account-name accountname --container-name container-name --account-key "account-key" --query "[?properties.blobTier=='Archive'].name" --output tsv
Also, I added ForEach-Object
to get the "rehydrate" information with print messages.
az storage blob list --account-name <account name> --container-name <container name> --account-key "<account key>" --query "[?properties.blobTier=='Archive'].name" --output tsv | ForEach-Object { Write-Output "Blob: $_ | Tier: Archive"; Write-Output "Rehydrating blob: $_" }
I successfully got the list of archived blobs
Output:
It may be due to there were no Archive-tier blobs at the time, or the wrong property access tier
was used earlier.
Reference: