Comments (7)
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @jlichwa @RandalliLama @schaabs.
from azure-sdk-for-python.
Hi @jasperkpi, thank you for opening an issue -- I see how this scenario could be frustrating. @jlichwa, do you know if there's an option on the service's end to restrict the number of results we get from this operation?
from azure-sdk-for-python.
@jasperkpi I tried reproducing your issue and found the same behavior; iterating over the full set of versions (after I had created 20,000) took a long time, and the sorting was deterministic but not chronological.
If your primary goal is just to get a small batch of secret versions for inspection, I would recommend using the by_page() method on the ItemPaged
object you get back from list_properties_of_secret_versions
. This will group the response into smaller pages that can be rapidly inspected. For example:
versions = client.list_properties_of_secret_versions(secret_name)
pages = versions.by_page()
single_page = next(pages)
for secret_properties in single_page:
print(secret_properties.version)
The default page size is 25 entries, but you can change this by passing a smaller integer through a max_page_size
keyword argument to list_properties_of_secret_versions
.
If you specifically need the most recent versions of the secret, this seems to unfortunately require manual sorting (unless @jlichwa can comment on an alternative once he's back in the office). The other alternative could be to create new secrets instead of a new version of the same secret, though I understand how having a single secret name could be a requirement for shared referencing and simplicity.
from azure-sdk-for-python.
Hi @jasperkpi. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.
from azure-sdk-for-python.
@mccoyp Thanks for your answer. I thought this would be the case. Unfortunately, I am looking for the most recent versions just to recover the not-current-but-last key. So only the recent 2 or 3 would be enough... This now means I have to get all 17.000 secret versions (with a OAuth refresh time of 10 minutes, versions are made at a rapid pace) and then sort them on changeddate.
versionlist = []
versions = client.list_properties_of_secret_versions(secret_name)
for version in versions:
versionlist += [f'{str(version.created_on)[:19]} {{{version.version}}} ']
sortedversionlist = sorted(versionlist, reverse=1)
I just hoped I was completely missing out a function of list_properties_of_secret_versions that delivered a sorted list or something. Thanks!
from azure-sdk-for-python.
@jasperkpi it may be more performant to use metadata, such as tags
, to record recent versions of the secret. That way you could fetch the most recent version of the key, inspect the tags, and then fetch the specific versions that are recorded. It would require multiple service requests, but it may save time overall.
I did discuss this with the service team and chronological version sorting unfortunately doesn't appear to be an option at this time. I'll mark this issue as resolved, but we'll be sure to incorporate this feedback into future planning. Thank you again for opening an issue!
from azure-sdk-for-python.
Hi @jasperkpi. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text "/unresolve" to remove the "issue-addressed" label and continue the conversation.
from azure-sdk-for-python.
Related Issues (20)
- Document Intelligence: support for multiple language at the same time during extraction HOT 2
- can't find back the documentation of the azure functions decorator package HOT 1
- Copying blob within account with BlobClient.upload_blob_from_url fails with ErrorCode:CannotVerifyCopySource HOT 3
- add the possibility to track metrics every few iterations/periods of time HOT 4
- Azure AI Search - Support for scalar quantization seems incomplete HOT 4
- ManagedIdentityCredential failing with version 1.17.0 HOT 7
- Documentation of the previous version of Python SDK is not visible/accessible for HOT 4
- Get service bus sender client by name regardless of type (queue/topic) HOT 1
- Effective Identity with Service Principal in Python HOT 4
- ValueError: Management Operation error occurred. When a task exceeds 240s with 5min lock out period HOT 14
- AzureAppConfigurationProvider should be able to lazy load secrets HOT 6
- A Question: What happens when we never close the AMPQ connection? HOT 8
- azure-communication-callautomation needs linting updates for pylint version 3.1.0 HOT 1
- azure-ai-documentintelligence AIO capability is not working HOT 5
- Is there no way to stream or wait for environment creation with ml_client HOT 3
- [bct] Add changelog reporting information in the README
- [bct] Rename tool
- SyntaxWarning: invalid escape sequence - azure-mgmt-network HOT 2
- yntaxWarning: invalid escape sequence - azure-mgmt-keyvault HOT 2
- Using Azure SDK for Python to run Workflows in Azure Purview HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from azure-sdk-for-python.