Can someone let me know how go about obtaining all the resources within an Azure Subscription. I tried the following:
az resource list
The above just spewed out a lot of JSON that didn’t really make any sense.
Can someone let me know how go about obtaining all the resources within an Azure Subscription. I tried the following:
az resource list
The above just spewed out a lot of JSON that didn’t really make any sense.
2
Answers
The JSON that it spewed out is a JSON Array that gives information about each resource in a JSON object such as location, resource group, tags, sku (if applicable), id, created and changed time and more. I think you might only want name and resource type in which case you can add query to that command like –
The Azure CLI uses JSON as its default output format, but offers other formats, including (but not limited to):
table
: ASCII table with keys as column headingstsv
: Tab-separated values, with no keysyaml
: YAML, a human-readable alternative to JSONUse the
--output
(--out
or-o
) parameter to format CLI output.Example
Get the names of the resources in a subscription:
Example output: