Azure Retail Pricesheet Api is broken

Anurag singh kuhswaha 31 Reputation points
2023-09-07T03:17:13.2766667+00:00

Seems like there is change in api we can do pagination by 1000 now but Pagination is not working.

Azure Retail Prices API stopped responding the NextPageLink property to help with paginating through all the items.

Steps to reproduce:

  1. GET https://prices.azure.com/api/retail/prices?$filter=serviceName eq 'Virtual Machines'
  2. Check the NextPageLink property

Expected:

It contains the link to the next page, e.g. https://prices.azure.com/api/retail/prices?$filter=serviceName eq 'Virtual Machines'&$skip=1000

Actual:

It's empty.

Workaround:

Generating the link yourself. Instead of getting the next page link from the response, check the returned item count. If it's 1000, then increment the skip counter and request again.

The behavior of NextPageLink is documented: https://learn.microsoft.com/en-us/rest/api/cost-management/retail-prices/azure-retail-prices#api-response-pagination

We noticed it being empty today (2023-09-07).

Furthermore, this happens with both the default and the preview API versions.

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

1 answer

Sort by: Most helpful
  1. Swathi Dhanwada 18,781 Reputation points Microsoft Employee
    2023-09-07T15:28:23.44+00:00

    Anurag singh kuhswaha There was some changes introduced to the Azure Retail API recently to increase the number of items returned per page. We observed some throttling causing this issue - occasionally API returns empty items when the throttling happening. We have taken the counter steps to overcome the throttling and it should not be an issue anymore.

    If in case the throttling happens, you will be notified 429 status with a re-try time instead of giving empty response in future. Product team is working on fixing this issue.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.