Skip to content

az-cli list is unaccurate compare to az-cli show #27702

@gesnaud

Description

@gesnaud

Describe the bug

When displaying attributes values with az-cli list, some values are false regarding the result of az-cli show
The show command is the true one (because i double check with JOSN view in azure portal).

Below an example with private dns zones (i did not test with other resources), you could observe that the numberOfVirtualNetworkLinks values are not the same even if it is the same resource.

Related command

az network private-dns zone list -g your_rg

$ az network private-dns zone list -g rg-...-001

[
  {
    "etag": "95...7ce",
    "id": "/subscriptions/65...e/resourceGroups/rg-...-001/providers/Microsoft.Network/privateDnsZones/privatelink.blob.core.windows.net",
    "location": "global",
[...]
    "type": "Microsoft.Network/privateDnsZones"
  },
  {
    "etag": "95...7ce",
    "id": "/subscriptions/65...e/resourceGroups/rg-...-001/providers/Microsoft.Network/privateDnsZones/privatelink.dfs.core.windows.net",
    "location": "global",
[...]
    "type": "Microsoft.Network/privateDnsZones"
  },
  {
    "etag": "95...7ce",
    "id": "/subscriptions/65...e/resourceGroups/rg-...-001/providers/Microsoft.Network/privateDnsZones/privatelink.snowflakecomputing.com",
    "location": "global",
    "maxNumberOfRecordSets": 25000,
    "maxNumberOfVirtualNetworkLinks": 1000,
    "maxNumberOfVirtualNetworkLinksWithRegistration": 100,
    "name": "privatelink.snowflakecomputing.com",
    "numberOfRecordSets": 6,
    "numberOfVirtualNetworkLinks": 0,   //<================== FALSE !!!
    "numberOfVirtualNetworkLinksWithRegistration": 0,
    "provisioningState": "Succeeded",
    "resourceGroup": "rg-weu-dea-hpr-network-c2-001",
    "tags": {
      "deployment": "manual"
    },
    "type": "Microsoft.Network/privateDnsZones"
  }
]

az network private-dns zone show -g your_rg -n your_pdz

$ az network private-dns zone show -g rg-...-001 -n privatelink.snowflakecomputing.com
{
  "etag": "95...7ce",
  "id": "/subscriptions/65...e/resourceGroups/rg-...-001/providers/Microsoft.Network/privateDnsZones/privatelink.snowflakecomputing.com",
  "location": "global",
  "maxNumberOfRecordSets": 25000,
  "maxNumberOfVirtualNetworkLinks": 1000,
  "maxNumberOfVirtualNetworkLinksWithRegistration": 100,
  "name": "privatelink.snowflakecomputing.com",
  "numberOfRecordSets": 6,
  "numberOfVirtualNetworkLinks": 1, //<================== TRUE !!!
  "numberOfVirtualNetworkLinksWithRegistration": 0,
  "provisioningState": "Succeeded",
  "resourceGroup": "rg-weu-dea-hpr-network-c2-001",
  "tags": {
    "deployment": "manual"
  },
  "type": "Microsoft.Network/privateDnsZones"
}

Errors

No error message, values are just wrong.

Issue script & Debug output

Please check above

Expected behavior

The values should be the same whatever the command used

Environment Summary

cloudhsell$ az --version
azure-cli                         2.53.0 *

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Auto-AssignAuto assign by botAuto-ResolveAuto resolve by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamNetworkaz network vnet/lb/nic/dns/etc...Network - DNSaz network dnsService AttentionThis issue is responsible by Azure service team.act-quality-productivity-squadcustomer-reportedIssues that are reported by GitHub users external to the Azure organization.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions