Azure CLI 2 · Output and queries

Capture a value in a script

Use tsv output for a plain value without quotes.

ID=$(az vm show -g my-rg -n my-vm --query id --output tsv)

Official Azure CLI 2 documentation

More output and queries commands

All output and queries commands · Azure CLI 2 cheatsheet

Was this page helpful?