Azure Cloud Shell scripting

— 1 minute read

Storing variables permalink

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)