azure-cli-extensions icon indicating copy to clipboard operation
azure-cli-extensions copied to clipboard

[resource-graph] automatically paginate results

Open Klaas- opened this issue 2 years ago • 9 comments

Related command

az graph query

Extension name (the extension in question)

resource-graph 2.1.0

Description of issue (in as much detail as possible)

By default currently 100 results are passed as results to a query, you can increase this with --first to 1000. I would like an option to just get all results, no matter how many there are or how many pages it needs to paginate in background. Suggestion "--all" as new option.


Klaas- avatar Feb 07 '23 14:02 Klaas-

Thank you for your feedback. This has been routed to the support team for assistance.

ghost avatar Feb 08 '23 00:02 ghost

route to CXP team

yonzhan avatar Feb 08 '23 00:02 yonzhan

@Klaas- Thanks for reaching out to us and reporting this issue. We are looking into this issue and we will provide an update.

navba-MSFT avatar Feb 10 '23 02:02 navba-MSFT

@Klaas- Could you please let me know which graph query command are you trying to run ? awaiting your reply.

navba-MSFT avatar Feb 10 '23 12:02 navba-MSFT

@Klaas- Could you please let me know which graph query command are you trying to run ? awaiting your reply.

az graph query -q "Resources" but this should happen in every query that has enough responses :)

Klaas- avatar Feb 10 '23 19:02 Klaas-

Default: 100

$ az graph query -q "Resources" --query '{Count: count,Total_Records: total_records}'
{
  "Count": 100,
  "Total_Records": 28389
}

Can be increased to 1000 via --first

$ az graph query -q "Resources" --first 1000 --query '{Count: count,Total_Records: total_records}'
{
  "Count": 1000,
  "Total_Records": 28389
}

$ az graph query -q "Resources" --first 2000 --query '{Count: count,Total_Records: total_records}'
Value of --first has to be between 1 and 1000.

And my fictitious "--all" parameter would show:

$ az graph query -q "Resources" --all --query '{Count: count,Total_Records: total_records}'
{
  "Count": 28389,
  "Total_Records": 28389
}

The use case is of cause not showing the total count, but I produce a list of resources that I want to iterate over, in this case all my resources.

Klaas- avatar Feb 13 '23 08:02 Klaas-

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

Issue Details

Related command

az graph query

Extension name (the extension in question)

resource-graph 2.1.0

Description of issue (in as much detail as possible)

By default currently 100 results are passed as results to a query, you can increase this with --first to 1000. I would like an option to just get all results, no matter how many there are or how many pages it needs to paginate in background. Suggestion "--all" as new option.


Author: Klaas-
Assignees: -
Labels:

customer-reported, Resource Graph, Service Attention, needs-team-attention, feature-request

Milestone: -

ghost avatar Feb 13 '23 10:02 ghost

@Klaas- Thanks for clarifying.

I am adding service team to look into this ask.

@chiragg4u Could you please look into this and provide some pointers ? Thanks in advance.

navba-MSFT avatar Feb 13 '23 10:02 navba-MSFT

Hi, Facing the same topic here. Would you have some news on the implementation ? Thanks in advance for any feedback Regards

Ludovic-Emo-Pyl-Tech avatar May 15 '24 19:05 Ludovic-Emo-Pyl-Tech