Skip to content

Same CLI query (az resource list) returns different results in cloud shell vs. local #21884

@plzm

Description

@plzm

This is autogenerated. Please review and update as needed.

Describe the bug

Command Name
az resource list

Errors:

Local results fewer than identical query run in cloud shell.

The query run locally (including in GitHub hosted Actions runner) does not return Microsoft.Compute/virtualMachines or Microsoft.network/networkInterfaces resources that are in the RG. The same query run in cloud shell does return those resources.

To Reproduce:

Using Azure CLI 2.34.1 in both local (WSL2, Ubuntu 20.04) and cloud shell.

This exact query:

az resource list --subscription "4ca1851f-9d7a-456e-b346-1709991ecaff" -g "pz-vm-prod-eastus2" -o tsv --query '[].id'

Returns fewer results locally than in cloud shell.

Expected Behavior

Local returns all results in resource group, matches cloud shell output.

Environment Summary

Windows-10-10.0.19041-SP0
Python 3.8.9
Installer: 

azure-cli 2.34.1

Additional Context

Also I did the following repeatedly locally:
az logout
az cache purge
az account clear
and deleted ~/.azure.

Also note that I updated my computer to Python 3.10 x64, but az --version output in WSL2 still shows Python x86 3.8.9.

Adding files:

  • rg.png - showing the contents of the resource group in question, with hidden resources displayed
  • local.png - local az cli query output
  • cloud_shell.png - cloud shell az cli query output
  • az_version_local.png - local az --version
  • az_version_cloud_shell.png - cloud shell az --version
  • local_debug.txt - local az cli query output with --verbose --debug

rg

local

cloud_shell

az_version_local

az_version_cloud_shell

local_debug.txt

Metadata

Metadata

Labels

ARMaz resource/group/lock/tag/deployment/policy/managementapp/account management-groupAuto-AssignAuto assign by botact-identity-squadcustomer-reportedIssues that are reported by GitHub users external to the Azure organization.feature-request

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions