Created
December 6, 2021 07:27
-
-
Save georgeOsdDev/4d68e9eade63cb22511c195892769d38 to your computer and use it in GitHub Desktop.
Get all storages used by azure function app
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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