def get_azure_secret(self, vault_name, key_name, version=None, **kwargs): ''' @dev get secret from azure key vault @param vault_name key vault name @param key_name sercrt's key @param version version of the secret to get. if unspecified, gets the latest version @return secret(KeyVaultSecret) ''' update_mempool = True secret = None key = self.create_memory_key_with_args(vault_name, key_name, version) if self.use_mempool: secret = self.get_memory_key_value(key) if not secret: secret = azure_get_secret(vault_name, key_name, version, **kwargs) else: update_mempool = False else: secret = azure_get_secret(vault_name, key_name, version, **kwargs) if update_mempool: self.set_memory_key_value(key, secret) return secret