Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save geralexgr/45dedb003a8cf8a25fcb1187e2fc4445 to your computer and use it in GitHub Desktop.
Save geralexgr/45dedb003a8cf8a25fcb1187e2fc4445 to your computer and use it in GitHub Desktop.
$container_name_input = "backups"
$sg_con_string = "XXX"
$json = az storage blob list --container-name $container_name_input --connection-string $sg_con_string | ConvertFrom-Json | Sort-Object -Descending { $_.properties.CreationTime } | Select-Object name
az storage blob download --file $json[0].name --name $json[0].name --container-name $container_name_input --connection-string $sg_con_string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment