Commit 6a40c757 authored by kiranveerapaneni's avatar kiranveerapaneni
Browse files

removing Cosmo client hardcoding initialisation

parent d6b815bf
Pipeline #71350 failed with stages
in 14 seconds
......@@ -30,26 +30,9 @@ public class AzureBootstrapConfig {
@Value("${azure.keyvault.url}")
private String keyVaultURL;
@Value("${osdu.azure.partitionId}")
private String partitionId;
@Bean
@Named("KEY_VAULT_URL")
public String keyVaultURL() {
return keyVaultURL;
}
/*This is done to support Single partition support for slb. Once implementation is complete for multi-partition we can remove this method */
@Bean
public CosmosClient buildCosmosClient(SecretClient kv) {
final String partitionId = getPartitionId();
final String cosmosEndpoint = KeyVaultFacade.getSecretWithValidation(kv, String.format("%s-cosmos-endpoint", partitionId));
final String cosmosPrimaryKey = KeyVaultFacade.getSecretWithValidation(kv, String.format("%s-cosmos-primary-key", partitionId));
return new CosmosClientBuilder().endpoint(cosmosEndpoint).key(cosmosPrimaryKey).buildClient();
}
public String getPartitionId() {
return this.partitionId;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment