Skip to content

Instantly share code, notes, and snippets.

@georgeOsdDev
Created December 6, 2021 07:27
Show Gist options
  • Save georgeOsdDev/4d68e9eade63cb22511c195892769d38 to your computer and use it in GitHub Desktop.
Save georgeOsdDev/4d68e9eade63cb22511c195892769d38 to your computer and use it in GitHub Desktop.
Get all storages used by azure function app
#!/bin/bash -l
set -Ceu
ids=`az functionapp list --query '[].id' -o tsv`
for id in $ids; do
read rg name <<< $(echo $id | awk -F '/' '{print $5, $9}')
storage=$(az functionapp config appsettings list -g $rg -n $name --query "[?name == 'AzureWebJobsStorage'].value" -o tsv | awk -F ';' '{for(i = 1; i <= NF; i++){printf $i "\n"}}' | grep AccountName | awk -F '=' '{print $2}')
echo $rg, $name, $storage
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment