Source:
public void addKeyVaultPropertySource(String normalizedName) { final String vaultUri = getPropertyValue(normalizedName, Property.URI); Assert.notNull(vaultUri, "vaultUri must not be null!"); final Long refreshInterval = Optional.ofNullable(getPropertyValue(normalizedName, Property.REFRESH_INTERVAL)) .map(Long::valueOf) .orElse(DEFAULT_REFRESH_INTERVAL_MS); final List<String> secretKeys = Binder.get(this.environment) .bind( KeyVaultProperties.getPropertyName(normalizedName, Property.SECRET_KEYS), Bindable.listOf(String.class) ) .orElse(Collections.emptyList()); final TokenCredential tokenCredential = getCredentials(normalizedName); final SecretClient secretClient = new SecretClientBuilder() .vaultUrl(vaultUri) .credential(tokenCredential) .serviceVersion(SecretServiceVersion.V7_0) .httpLogOptions(new HttpLogOptions().setApplicationId(AZURE_SPRING_KEY_VAULT)) .buildClient(); try { final MutablePropertySources sources = this.environment.getPropertySources(); final boolean caseSensitive = Boolean .parseBoolean(getPropertyValue(normalizedName, Property.CASE_SENSITIVE_KEYS)); final KeyVaultOperation keyVaultOperation = new KeyVaultOperation( secretClient, refreshInterval, secretKeys, caseSensitive); String propertySourceName = Optional.of(normalizedName) .map(String::trim) .filter(s -> !s.isEmpty()) .orElse(AZURE_KEYVAULT_PROPERTYSOURCE_NAME); KeyVaultPropertySource keyVaultPropertySource = new KeyVaultPropertySource(propertySourceName, keyVaultOperation); if (sources.contains(SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME)) { sources.addAfter( SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME, keyVaultPropertySource ); } else { sources.addFirst(keyVaultPropertySource); } } catch (final Exception ex) { throw new IllegalStateException("Failed to configure KeyVault property source", ex); } }

Target:
public void addKeyVaultPropertySource(String normalizedName) { final String vaultUri = getPropertyValue(normalizedName, Property.URI); final String version = getPropertyValue(normalizedName, Property.SECRET_SERVICE_VERSION); SecretServiceVersion secretServiceVersion = Arrays.stream(SecretServiceVersion.values()) .filter(val -> val.getVersion().equals(version)) .findFirst() .orElse(null); Assert.notNull(vaultUri, "vaultUri must not be null!"); final Long refreshInterval = Optional.ofNullable(getPropertyValue(normalizedName, Property.REFRESH_INTERVAL)) .map(Long::valueOf) .orElse(DEFAULT_REFRESH_INTERVAL_MS); final List<String> secretKeys = Binder.get(this.environment) .bind( KeyVaultProperties.getPropertyName(normalizedName, Property.SECRET_KEYS), Bindable.listOf(String.class) ) .orElse(Collections.emptyList()); final TokenCredential tokenCredential = getCredentials(normalizedName); final SecretClient secretClient = new SecretClientBuilder() .vaultUrl(vaultUri) .credential(tokenCredential) .serviceVersion(secretServiceVersion) .httpLogOptions(new HttpLogOptions().setApplicationId(AZURE_SPRING_KEY_VAULT)) .buildClient(); try { final MutablePropertySources sources = this.environment.getPropertySources(); final boolean caseSensitive = Boolean .parseBoolean(getPropertyValue(normalizedName, Property.CASE_SENSITIVE_KEYS)); final KeyVaultOperation keyVaultOperation = new KeyVaultOperation( secretClient, refreshInterval, secretKeys, caseSensitive); String propertySourceName = Optional.of(normalizedName) .map(String::trim) .filter(s -> !s.isEmpty()) .orElse(AZURE_KEYVAULT_PROPERTYSOURCE_NAME); KeyVaultPropertySource keyVaultPropertySource = new KeyVaultPropertySource(propertySourceName, keyVaultOperation); if (sources.contains(SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME)) { sources.addAfter( SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME, keyVaultPropertySource ); } else { sources.addFirst(keyVaultPropertySource); } } catch (final Exception ex) { throw new IllegalStateException("Failed to configure KeyVault property source", ex); } }