java.lang.IllegalStateException: Failed to configure Key Vault property source

Jayashree Madanala 1 Reputation point
2020-09-07T05:48:16.04+00:00

I am having issues when i am using azure-keyvault-secrets-spring-boot-starter of 2.3.3 version.

application.properties
azure.keyvault.uri=...........
azure.keyvault.enabled=true
azure.client-id=........
azure.client-key=.......

10:00:47.863 [main] ERROR org.springframework.boot.SpringApplication - Application run failed
java.lang.IllegalStateException: Failed to configure KeyVault property source
at com.microsoft.azure.keyvault.spring.KeyVaultEnvironmentPostProcessorHelper.addKeyVaultPropertySource(KeyVaultEnvironmentPostProcessorHelper.java:110)
at com.microsoft.azure.keyvault.spring.KeyVaultEnvironmentPostProcessor.postProcessEnvironment(KeyVaultEnvironmentPostProcessor.java:47)
at org.springframework.boot.context.config.ConfigFileApplicationListener.onApplicationEnvironmentPreparedEvent(ConfigFileApplicationListener.java:200)
at org.springframework.boot.context.config.ConfigFileApplicationListener.onApplicationEvent(ConfigFileApplicationListener.java:188)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(

Azure Key Vault
Azure Key Vault
An Azure service that is used to manage and protect cryptographic keys and other secrets used by cloud apps and services.
1,283 questions
Azure Spring Apps
Azure Spring Apps
An Azure platform as a service for running Spring Boot applications at cloud scale. Previously known as Azure Spring Cloud.
124 questions
{count} votes

1 answer

Sort by: Most helpful
  1. AmanpreetSingh-MSFT 56,601 Reputation points
    2020-09-07T17:20:02.647+00:00

    Hi @Jayashree Madanala

    Depending on the user or application context that you are using to configure Key Vault properties, you must grant required access to that identity via key vault access policies. Looking at the parameters that you have shared, it appears to be using application context.

    You can try the steps mentioned in the document here: https://video2.skills-academy.com/en-us/azure/developer/java/spring-framework/configure-spring-boot-starter-java-app-with-azure-key-vault, which includes the steps to

    • Create a key vault
    • Configure required permissions
    • Store secrets in that key vault

    and retrieve the secret from the keyvault via https://{your-appservice-name}.azurewebsites.net/get url.

    -----------------------------------------------------------------------------------------------------------

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.