Azure / Azure/azure-cli-extensions

resource-graph extension limited to 500 results

Open
#4,144 3 comments 0 reactions 0 assignees View on GitHub
customer-reported Resource Graph Service Attention
Dominant language
Python
Stars
454
Forks
1.7k
Avg merge
2d 19h
Merged PRs (30d)
64

Description

### 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.
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.