Open ahsonkhan opened 4 days ago
As discussed offline, this is by design, see guidelines: https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#collections
Re-open, as we discovered that the service was doing the wrong thing, so it may require some custom code to make it work.
The call to fetch the first page sets the appropriate query parameters based on the input parameter value: https://github.com/Azure/azure-sdk-for-python/blob/e821a490762956edf8c285ae9cba21c9ca267a7b/sdk/keyvault/azure-keyvault-certificates/azure/keyvault/certificates/_client.py#L641-L649
But subsequent pages do not have that value set. This is done in the generated code. That means, if the include_pending param is set to true, it will not return all the certificates (including pending ones), if the pending certificate happens to be listed in a page other than the first. https://github.com/Azure/azure-sdk-for-python/blob/e821a490762956edf8c285ae9cba21c9ca267a7b/sdk/keyvault/azure-keyvault-certificates/azure/keyvault/certificates/_generated/_operations/_operations.py#L784-L816
Here's the swagger (not sure if this requires some fix to the swagger): https://github.com/Azure/azure-rest-api-specs/blob/4a4acecea9901c29e19ba50f2d4cf65b20115b69/specification/keyvault/data-plane/Microsoft.KeyVault/stable/7.5/certificates.json#L30-L83
Sample repro:
The issue is pervasive across all the
ItemPaged
methods that follow this pattern within the KeyVault SDKs, butlist_properties_of_certificates
andlist_deleted_certificates
(along withlist_role_assignments
in KeyVault Administration) seem to be the only ones that have optional parameters which are settable by the SDK methods (unlike maxResults) and hence have an actual behavioral bug here.It's possible that some other service SDKs have similar concerns here.
Related issues in other languages: https://github.com/Azure/azure-sdk-for-net/issues/47202 https://github.com/Azure/azure-sdk-for-cpp/issues/6235 https://github.com/Azure/azure-sdk-for-python/issues/38589 https://github.com/Azure/azure-sdk-for-go/issues/23772 https://github.com/Azure/azure-sdk-for-js/issues/31803 https://github.com/Azure/azure-sdk-for-java/issues/42988