Skip to content

Instantly share code, notes, and snippets.

Embed
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
@codingoutloud
Copy link
Author

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

@codingoutloud
Copy link
Author

@alexandair
Copy link

Haven't you hardcoded 'billtestmar2'?

@codingoutloud
Copy link
Author

@alexandair oops! I did - fixed now

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