az resource list

This Azure article will discuss the syntax and usage of the Az resource list Azure CLI command with an example of how to use this command.

az resource list

This command can help you to retrieve the lists of Azure resources.

Syntax of AZ resource list

Below is the syntax of the az resource list command.

az resource list
az resource list [--location]
az resource list 
[--name]

Examples

Below are examples of how to use the Az resource list Azure CLI command.

Example-1:

You can execute the Azure CLI command below to retrieve the Azure resource lists.

az resource list 

After executing the above command, I got the below-expected output.

[      
  {
    "changedTime": "2023-01-16T07:39:26.554970+00:00",
    "createdTime": "2023-01-16T07:28:56.408866+00:00",
    "extendedLocation": null,
    "id": "/subscriptions/1cdf4300-dee5-4518-9c9c-feaa72a5cbd1/resourceGroups/cloud-shell-storage-centralindia/providers/Microsoft.Storage/storageAccounts/csg1003bffda6faf387",
    "identity": null,
    "kind": "StorageV2",
    "location": "centralindia",
    "managedBy": null,
    "name": "csg1003bffda6faf387",
    "plan": null,
    "properties": null,
    "provisioningState": "Succeeded",
    "resourceGroup": "cloud-shell-storage-centralindia",
    "sku": {
      "capacity": null,
      "family": null,
      "model": null,
      "name": "Standard_LRS",
      "size": null,
      "tier": "Standard"
    },
    "tags": {
      "ms-resource-usage": "azure-cloud-shell"
    },
    "type": "Microsoft.Storage/storageAccounts"
  },
  {
    "changedTime": "2021-05-20T07:40:20.457783+00:00",
    "createdTime": "2021-05-20T07:30:18.839494+00:00",
    "extendedLocation": null,
    "id": "/subscriptions/1cdf4300-dee5-4518-9c9c-feaa72a5cbd1/resourceGroups/MyNewResGrp/providers/microsoft.alertsmanagement/smartDetectorAlertRules/Failure Anomalies - NewPowerShellAzureFNApp202105201249",
    "identity": null,
    "kind": null,
    "location": "global",
    "managedBy": null,
    "name": "Failure Anomalies - NewPowerShellAzureFNApp202105201249",
    "plan": null,
    "properties": null,
    "provisioningState": "Succeeded",
    "resourceGroup": "MyNewResGrp",
    "sku": null,
    "tags": {},
    "type": "microsoft.alertsmanagement/smartDetectorAlertRules"
  },
  {
    "changedTime": "2021-09-29T08:57:24.152706+00:00",
    "createdTime": "2021-09-29T08:47:23.769858+00:00",
    "extendedLocation": null,
    "id": "/subscriptions/1cdf4300-dee5-4518-9c9c-feaa72a5cbd1/resourceGroups/GroupAzure/providers/microsoft.alertsmanagement/smartDetectorAlertRules/Failure Anomalies - groupazureapp",
    "identity": null,
    "kind": null,
    "location": "global",
    "managedBy": null,
    "name": "Failure Anomalies - groupazureapp",
    "plan": null,
    "properties": null,
    "provisioningState": "Succeeded",
    "resourceGroup": "GroupAzure",
    "sku": null,
    "tags": {},
    "type": "microsoft.alertsmanagement/smartDetectorAlertRules"
  },
  {
    "changedTime": "2022-08-03T11:37:54.108829+00:00",
    "createdTime": "2022-08-03T11:27:53.643115+00:00",
    "extendedLocation": null,
    "id": "/subscriptions/1cdf4300-dee5-4518-9c9c-feaa72a5cbd1/resourceGroups/TsinfoNew_group/providers/microsoft.alertsmanagement/smartDetectorAlertRules/Failure Anomalies - TsinfoNew",
    "identity": null,
    "kind": null,
    "location": "global",
    "managedBy": null,
    "name": "Failure Anomalies - TsinfoNew",
    "plan": null,
    "properties": null,
    "provisioningState": "Succeeded",
    "resourceGroup": "TsinfoNew_group",
    "sku": null,
    "tags": {},
    "type": "microsoft.alertsmanagement/smartDetectorAlertRules"
  }

You can see the same output in the below screenshot.

az resource list

Example-2:

You can execute the Azure CLI command below to help you retrieve the lists of Azure resources from the specified region.

az resource list --location CentralUS

After executing the above command, I got the below-expected output

[      
  {
    "changedTime": "2023-09-14T08:14:07.516634+00:00",
    "createdTime": "2023-09-14T08:03:36.784361+00:00",
    "extendedLocation": null,
    "id": "/subscriptions/1cdf4300-dee5-4518-9c9c-feaa72a5cbd1/resourceGroups/demo358/providers/Microsoft.Storage/storageAccounts/mytargetstorageaccount2",
    "identity": null,
    "kind": "StorageV2",
    "location": "centralus",
    "managedBy": null,
    "name": "mytargetstorageaccount2",
    "plan": null,
    "properties": null,
    "provisioningState": "Succeeded",
    "resourceGroup": "demo358",
    "sku": {
      "capacity": null,
      "family": null,
      "model": null,
      "name": "Standard_RAGRS",
      "size": null,
      "tier": "Standard"
    },
    "tags": {},
    "type": "Microsoft.Storage/storageAccounts"
  },
  {
    "changedTime": "2023-09-14T08:19:33.018804+00:00",
    "createdTime": "2023-09-14T08:09:04.472484+00:00",
    "extendedLocation": null,
    "id": "/subscriptions/1cdf4300-dee5-4518-9c9c-feaa72a5cbd1/resourceGroups/demo589/providers/Microsoft.Storage/storageAccounts/mytargetstorageaccountg",
    "identity": null,
    "kind": "StorageV2",
    "location": "centralus",
    "managedBy": null,
    "name": "mytargetstorageaccountg",
    "plan": null,
    "properties": null,
    "provisioningState": "Succeeded",
    "resourceGroup": "demo589",
    "sku": {
      "capacity": null,
      "family": null,
      "model": null,
      "name": "Standard_RAGRS",
      "size": null,
      "tier": "Standard"
    },
    "tags": {},
    "type": "Microsoft.Storage/storageAccounts"
  }

You can see the same output as below.

az resource list --location

You may also like following the articles below

Conclusion

This Azure CLI article discussed the syntax and usage of the az resource list command with certain examples of how to use this command. Thanks for reading this example !!!