Skip to content

[CC-002] Azure cost collection pagination incomplete #14

@LFigg

Description

@LFigg

Description

Azure Cost Management API pagination may be incomplete. The code may not properly handle all pages of results for large date ranges or many subscriptions.

Location

  • File: cost_collect.py - Azure cost collection function

Impact

  • Medium - Cost data may be truncated for large environments
  • Incorrect cost totals reported

Suggested Fix

Ensure pagination follows Azure Cost Management API patterns:

results = []
skip_token = None
while True:
    response = client.query(
        scope=scope,
        parameters=query_params,
        skip_token=skip_token
    )
    results.extend(response.rows)
    skip_token = getattr(response.properties, 'next_link', None)
    if not skip_token:
        break

Priority

Medium

Source

cost_collect.py code review - CC-002

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions