Azure / azure-cli-extensions

Public Repository for Extensions of Azure CLI.
https://docs.microsoft.com/en-us/cli/azure
MIT License
380 stars 1.2k forks source link

resource-graph extension limited to 500 results #4144

Open divz1323 opened 2 years ago

divz1323 commented 2 years ago

Extension name (the extension in question)

resource-graph

Description of issue (in as much detail as possible)

According to the official documentation, maximum number of objects to return using the --first parameter is 1000 but that doesn't seem to be the case. I'm running a very simple query. From the Azure portal, I can see that there are around 700 resource groups in the subscription but this query is only returning 500.

$resource_groups = az graph query -q "Resources | distinct resourceGroup" --first 1000
($resource_groups | ConvertFrom-Json).data.count

Azure Powershell (Az.ResourceGraph) cmdlet Search-AzGraph is also only returning only 500 objects.

(Search-AzGraph -Query "Resources | distinct resourceGroup" -First 1000).count

Version Info

PS C:\Users\xxx> az --version
azure-cli                         2.30.0

core                              2.30.0
telemetry                          1.0.6

Extensions:
resource-graph                     2.1.0

Python location 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe'
Extensions directory 'C:\Users\xxx\.azure\cliextensions'

Python (Windows) 3.8.9 (tags/v3.8.9:a743f81, Apr  6 2021, 13:22:56) [MSC v.1928 32 bit (Intel)]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.
ghost commented 2 years ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @chiragg4u.

Issue Details
### Extension name (the extension in question) resource-graph ### Description of issue (in as much detail as possible) According to the [official documentation](https://docs.microsoft.com/en-us/cli/azure/graph?view=azure-cli-latest#az_graph_query-optional-parameters), maximum number of objects to return using the `--first` parameter is 1000 but that doesn't seem to be the case. I'm running a very simple query. From the Azure portal, I can see that there are around 700 resource groups in the subscription but this query is only returning 500. ```powershell $resource_groups = az graph query -q "Resources | distinct resourceGroup" --first 1000 ($resource_groups | ConvertFrom-Json).data.count ``` Azure Powershell (Az.ResourceGraph) cmdlet Search-AzGraph is also only returning only 500 objects. ```powershell (Search-AzGraph -Query "Resources | distinct resourceGroup" -First 1000).count ``` ----- ### Version Info ``` PS C:\Users\xxx> az --version azure-cli 2.30.0 core 2.30.0 telemetry 1.0.6 Extensions: resource-graph 2.1.0 Python location 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe' Extensions directory 'C:\Users\xxx\.azure\cliextensions' Python (Windows) 3.8.9 (tags/v3.8.9:a743f81, Apr 6 2021, 13:22:56) [MSC v.1928 32 bit (Intel)] Legal docs and information: aka.ms/AzureCliLegal Your CLI is up-to-date. ```
Author: divz1323
Assignees: -
Labels: `customer-reported`, `Resource Graph`, `Service Attention`
Milestone: -
yonzhan commented 2 years ago

route to service team

dhu5432 commented 1 year ago

@divz1323 Are you still experiencing this issue?