Azure / Azure/azure-rest-api-specs

Microsoft.Consumption PriceSheets API is Paginated - Generated Config Says Otherwise

Open
#21,139 5 comments 0 reactions 0 assignees View on GitHub
bug Consumption - Billing customer-reported Service Attention
Dominant language
TypeSpec
Stars
3.1k
Forks
5.9k
Avg merge
2d 22h
Merged PRs (30d)
444

Description

Using the Azure SDK for Python -> ConsumptionManagementClient and the price_sheet.get_by_billing_period action, I would expect to get all pricing for the given account and billing period.

The SDK returns 1000 results and a next link to retrieve the remaining results. The root cause is that the SDK doesn't see the price sheets API endpoint as paginated, so it doesn't attempt to walk the data set:

See: https://github.com/Azure/azure-rest-api-specs/blob/main/specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/consumption.json

The JSON objects at 1295 and 1358 should include the x-ms-pageable property, specifying the next_link property, **which does exist in the response:**

![image](https://user-images.githubusercontent.com/14931610/195931657-7047d69f-9329-483a-b582-bebf83190824.png)

Contributor guide

Open the contributing guide

Research direction

Open specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/consumption.json and inspect the objects around lines 1295 and 1358. Confirm the response includes next_link, then update the pageable metadata for both operations and verify that generated Python SDK behavior retrieves pages beyond the first 1,000 results.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, openapi, python
Domain
api, cloud
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.