KeyVaultClient.GetSecretsAsync: maxresults upper limit isn't specified in docs
See original GitHub issueWe were using GetSecretsAsync
and recently needed to expand it to more than the default 25 results. However, when we made this change we got an exception message as follows:
Unhandled exception. Microsoft.Rest.ValidationException: 'maxresults' exceeds maximum value of '25'.
at Microsoft.Azure.KeyVault.KeyVaultClient.GetSecretsWithHttpMessagesAsync(String vaultBaseUrl, Nullable`1 maxresults, Dictionary`2 customHeaders, CancellationToken cancellationToken)
at Microsoft.Azure.KeyVault.KeyVaultClientExtensions.GetSecretsAsync(IKeyVaultClient operations, String vaultBaseUrl, Nullable`1 maxresults, CancellationToken cancellationToken)
It appears that there is a maximum allowable value of maxresults
of 25
, which the docs do not specify. We are changing our approach to use GetSecretsNextAsync
, which could be a Remark perhaps in the page for GetSecretsAsync/GetSecretsWithHttpMessagesAsync
if greater than 25 results are required.
I am assuming because of the exception message that it is intended for there to be a maximum of 25 results per call. So this issue is for the docs to be amended to be up-front about that limitation and explain the ideal work-around. My only worry is that this code worked locally, and not when deployed to run in Azure (in a test environment, thankfully), so we’re unsure where this discrepancy could have arisen from. If the issue is actually with our code and this maxresults
limit isn’t a fact, please let me know. Thank you.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: e6ddf60c-8c02-4b23-225f-2e8d676041e3
- Version Independent ID: cf2dabbd-c1e6-402e-1a92-ad5f6a6c7774
- Content: KeyVaultClientExtensions.GetSecretsAsync(IKeyVaultClient, String, Nullable<Int32>, CancellationToken) Method (Microsoft.Azure.KeyVault) - Azure for .NET Developers
- Content Source: xml/Microsoft.Azure.KeyVault/KeyVaultClientExtensions.xml
- Service: key-vault
- GitHub Login: @rloutlaw
- Microsoft Alias: routlaw
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
Thank you for your feedback. Tagging and routing to the team members best able to assist.
Hi @TechniMan, since you haven’t asked that we “
/unresolve
” the issue, we’ll close this out. If you believe further discussion is needed, please add a comment “/unresolve
” to reopen the issue.