Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

azurerm_key_vault_*: add TryCacheKeyvaultID function to speed up get keyvault id from keyvault URL #23405

Closed
wants to merge 1 commit into from

Conversation

wuxu92
Copy link
Contributor

@wuxu92 wuxu92 commented Sep 27, 2023

This is a short-term fixes #23404.

KeyVaultIDFromBaseUrl is time-consuming for listing almost all pages of the resources of the subscription to find the keyvault resource by name. This PR is trying to cache the mapping beween the keyvault URL and keyvault at first to void the ResourcesClient.List operation.

The process of finding the KeyVault resource by name using KeyVaultIDFromBaseUrl is time-consuming as it requires listing almost all pages of subscription resources. This PR aims to improve performance by caching the mapping between the KeyVault URL and its corresponding resource before the KeyVaultIDFromBaseUrl calls, thereby avoiding the need for a ResourcesClient.List operation. This PR won't speed up the terraform import.

@tombuildsstuff
Copy link
Contributor

hey @wuxu92

Thanks for this PR

As mentioned in #23413 I've been looking into how the Resources API is used across the provider more broadly - and as a result have ended up opening #24019 which implements a fix for this in a different manner (by retrieving and caching all of the Key Vaults within a Subscription when populating the cache - rather than doing these one at a time).

Since I believe that #24019 will resolve #23404 in a slightly different manner, which'll alleviate the need for a short-term workaround for this one, whilst I'd like to thank you for this contribution I'm going to close this PR in favour of #24019 which should solve this in a different manner.

Thanks!

Copy link

github-actions bot commented May 6, 2024

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

azurem_key_vault_key: Refreshing state with context deadline exceeded
2 participants