Using Azure CLI 2, show all the resources in a resource group
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 | |
if [ $1 ] | |
then | |
echo "Resources in Azure Resource Group $1" | |
az resource list --query "[?resourceGroup=='$1'].{ name: name, flavor: kind, resourceType: type, region: location }" --output table | |
else | |
echo "usage: $0 [name-of-azure-resource-group]" | |
fi |
Install Azure CLI: https://docs.microsoft.com/en-us/cli/azure/install-azure-cli
Haven't you hardcoded 'billtestmar2'?
@alexandair oops! I did - fixed now
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
make it runnable: chmod +x ./show-resourcegroup-contents.sh

example: ./show-resourcegroup-contents.sh billtestmar2
example output: