I know this is old, but answering this because I had the exact same issue and had to read a lot to figure it out.
Tutorial from Microsoft
This article will give you a pretty good overview.
To summarize, if you want to enable SSL for your application using a self signed certificate stored in the azure key vault, below are the steps
Add the azure-spring-boot-starter-keyvault-certificates
dependency in your pom.
Add the ssl configuration and the keyvault configuration as follows
server:
port: 8443
ssl:
key-alias: <keystore name>
key-store-password: <password>
keyStoreType: AzureKeyVault
key-store-type: AzureKeyVault
azure:
keyvault:
uri: <keystore uri>
client-id: <client-id>
client-secret: <secret>
enabled: true
tenant-id: <tenant-id>
This will enable ssl on your application and use the key store from azure for https.
If you need to load a trust store for only outbound TLS, things are a bit more simpler. You only need to configure key vault as below.
azure:
keyvault:
uri: <keystore uri>
client-id: <client-id>
client-secret: <secret>
enabled: true
tenant-id: <tenant-id>
And then, initialize your SSLContext using the key vault.
KeyStore azureKeyVaultKeyStore = KeyStore.getInstance("AzureKeyVault");
KeyVaultLoadStoreParameter parameter = new KeyVaultLoadStoreParameter(
System.getProperty("azure.keyvault.uri"),
System.getProperty("azure.keyvault.tenant-id"),
System.getProperty("azure.keyvault.client-id"),
System.getProperty("azure.keyvault.client-secret"));
azureKeyVaultKeyStore.load(parameter);
SSLContext sslContext = SSLContexts.custom()
.loadTrustMaterial(azureKeyVaultKeyStore, null)
.build();
This will load all your certificates available on the key vault to the trust store. I am not sure if this is needed if you only need the certificates for outbound TLS since Azure key vault can only store certificates which contain both private and public key pairs.