Skip to content

Instantly share code, notes, and snippets.

@nzthiago
Created January 14, 2025 22:49
Show Gist options
  • Save nzthiago/1175646ffb825eb0f5f20d982d6230c4 to your computer and use it in GitHub Desktop.
Save nzthiago/1175646ffb825eb0f5f20d982d6230c4 to your computer and use it in GitHub Desktop.
Bash script to list the runtimes/stacks supported per region for Flex Consumption
#!/bin/bash
commands=("az")
for cmd in "${commands[@]}"; do
if ! command -v "$cmd" &>/dev/null; then
echo "Error: $cmd command is not available. Please install $cmd"
exit 1
fi
done
echo "Loading all runtime version per region.\n"
regions=$(az functionapp list-flexconsumption-locations -o tsv)
runtimes=("dotnet-isolated" "node" "java" "python" "powershell")
for region in $regions; do
if [[ "$region" == "eastus2euap" || "$region" == "northcentralus(stage)" ]]; then
continue
fi
for runtime in ${runtimes[@]}; do
stackversions=$(az functionapp list-flexconsumption-runtimes --location $region --runtime $runtime --query '[].{version:version}' -o tsv)
for version in $stackversions; do
echo "$region $runtime $version"
done
done
done
echo "\nListed all function apps in all regions successfully."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment