Hi, from my spring boot application I want to connect to Azure Key Vault to retrieve secrets that have been stored within it, such as database access credentials.
At the moment, the only working solution to authenticate to Key Vault from the spring boot application is to use the client id and client secret associated with the application and the key vault endpoint in the spring boot application.properties file in this way.
#AZURE KEY VAULT CONFIG
spring.cloud.azure.keyvault.secret.property-sources[0].credential.client-id=APPLICATION_CLIENT_ID
spring.cloud.azure.keyvault.secret.property-sources[0].credential.client-secret=APPLICATION_CLIENT_SECRET
spring.cloud.azure.keyvault.secret.property-sources[0].endpoint=KEYVAULT_ENDPOINT
spring.cloud.azure.keyvault.secret.property-sources[0].profile.tenant-id=TENANT_ID
The Maven dependency used in the pom.xml file of the spring boot project is:
<dependency>
<groupId>com.azure.spring</groupId>
<artifactId>spring-cloud-azure-starter-keyvault-secrets</artifactId>
</dependency>
The application has been authorized to access the secrets and certificates registered on Azure Key Vault).
What I would like to do now is to modify the code described in such a way that authentication to Azure Key Vault no longer occurs via client id and client secret, but via certificate (client certificate authentication).
How can I do? How should I modify the code in the application.properties file? What are the Maven dependencies to import?