How to use next_link in Azure Costmanagement Python SDK at query?

MinHo Kim 21 Reputation points
2023-06-01T08:36:14.0733333+00:00

Hi, I'm facing an issue with pagination.

I'm using the azure-mgmt-costmanagement Python SDK to retrieve billing data.

When the number of rows exceeds 5000 in the QueryResult, the next_link value is provided. However, during my investigation, I couldn't find any information on how to use next_link in the azure-mgmt-costmanagement SDK. I'm trying to retrieve the next 5000 rows of data. Could someone please help me with this?

Azure Cost Management
Azure Cost Management
A Microsoft offering that enables tracking of cloud usage and expenditures for Azure and other cloud providers.
2,330 questions
{count} votes

Accepted answer
  1. SadiqhAhmed-MSFT 41,066 Reputation points Microsoft Employee
    2023-06-02T21:06:45.7966667+00:00

    Hello @MinHo Kim Thank you for contacting us on Microsoft Q&A platform. Happy to help!

    I understand that you are using the azure-mgmt-costmanagement Python SDK to retrieve billing data and when the number of rows exceeds 5000 in the QueryResult, the next_link value is provided and you are not aware of using next link.

    The only way to do it is by looping through until nextLink is null. I don’t have an example for Python but this should be close enough to give you an idea: https://gist.github.com/JoramM/c0538593c80822e37f6cd6d0d2c0c65f

    Hope this helps!


    If the response helped, do "Accept Answer" and up-vote it

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful