question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

KeyVaultClient.GetSecretsAsync: maxresults upper limit isn't specified in docs

See original GitHub issue

We 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.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jsquirecommented, Jul 14, 2021

Thank you for your feedback. Tagging and routing to the team members best able to assist.

0reactions
msftbot[bot]commented, Jul 21, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

KeyVaultClient (Microsoft Azure SDK for Key Vault 0.9.1 API)
Performs a DECRYPT operation using the specified key. ... Parameters: vault - The vault URI. maxresults - The maximum number of keys to...
Read more >
KeyVaultClientExtensions.xml
Deletes the certificate contacts for a specified key vault certificate. This operation requires the certificates/managecontacts permission. </remarks>. </Docs>.
Read more >
Microsoft.Azure.KeyVault.xml 3.0.0
<param name='maxresults'> Maximum number of results to return in a page. If not specified the service will return up to 25 results. </param>...
Read more >
Microsoft.Azure.KeyVault.xml 3.4.1
<param name='maxresults'> Maximum number of results to return in a page. If not specified the service will return up to 25 results. </param>...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found