Skip to main content

Azure Cloud Shell scripting

· One min read
Phil Stollery
Senior Technical Writer

I want to store the Resource Group name in a variable to use in a bash script.

RgName=`az group list --query '[].name' --output tsv`

The ` back tick is important — as it executes the command inside. Or just found out you can use:

RgName=$(az group list --query '[].name' --output tsv)