New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Limit at 100 returned objects? #16527
Comments
@holgerjay Thanks for trying out Resource Graph and for the question! The Search-AzureRmGraph (and Search-AzGraph) cmdlets have a parameter called First. By default, it is set to 100 if not defined. This is what is limiting your results. You can set the number lower or higher to match your needs. Please let me know if this fixes your issue. Thanks! p.s. If you just want the number of matching resources and not the resources themselves, you can simplify your query to @MicrosoftDocs/azure-cxp-triage Please assign to me, label as 'product-question', and #in-progress. |
Thank you @DCtheGeek - using the |
I just saw that this information is also part of the full help. Cool. Last question: Is there a reason that the parameter range goes up to 5000 only?
|
@holgerjay Resource Graph is in Preview. Limits like this are so they can test the functionality and scalability without negative impact to other services and capabilities. It may or may not change at GA. Not an answer, but the best I can give you today. Thanks again for the questions! @MicrosoftDocs/azure-cxp-triage #please-close |
Hi, I have started working on Azure Resource Graph and my resource group has resources 1082 but even using first parameter as -First 5000 it is returning 1000 entries only not more then that. |
PS /root> $query = "project name, type, resourceGroup, subscriptionId, tags" PS /root> $Result = Search-AzGraph -Query $query -Subscription 7484ec2d-e33a-478e-b532-1fbcd9980b2e -First 5000 |
@mark6628 Make sure you add the 'id' field to your query output when going over 1000 records, otherwise the autopaging in the CLI/PS won't work. |
Windows and Linux Search-AzGraph have a different maximum value for -First parameter. In Windows maximum limit is 5000, but Linux is 1000 Tested with PowerShell 7.1.3 and Az.ResourceGraph 0.9.0 in both environments In Windows: $results = Search-AzGraph -Query "where type != ''" -First 5001 In Linux: $results = Search-AzGraph -Query "where type !=''" -First 5000 |
Hi,
apparently, I can only return up to 100 results with my queries. I've tried to increase the limit to a very high value but it would still cut the results at 100 returned objects.
$graphQueryResult = Search-AzureRmGraph -Query "where type =~ 'Microsoft.Compute/virtualMachines' | limit 10000"
$graphQueryResult.Count
100
Is this a limitation with the preview? Or is there anything that could be configured?
Thanks
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
The text was updated successfully, but these errors were encountered: