Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Using Azure CLI 2, show all the resources in a resource group
#/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
Owner

codingoutloud commented Mar 12, 2017

make it runnable: chmod +x ./show-resourcegroup-contents.sh
example: ./show-resourcegroup-contents.sh billtestmar2
example output:
image

Haven't you hardcoded 'billtestmar2'?

Owner

codingoutloud commented Mar 13, 2017

@alexandair oops! I did - fixed now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment