英文:
Springboot application start up fails and missing logs when using azure.keyvault.secret.property-sources
问题
我正在尝试将我的用Kotlin编写的Spring Boot应用程序迁移到Azure。我在我的应用程序中添加了spring-cloud-azure-starter-keyvault-secrets:4.5.0
依赖,并将以下配置添加到application.properties
中。
my.secret=${my-azure-secret}
spring.cloud.azure.keyvault.secret.property-source-enabled=true
spring.cloud.azure.keyvault.secret.property-sources[0].endpoint=<my-vault>.vault.azure.net/
添加后,Spring Boot初始化不再起作用,我找不到任何日志。
log.info { "Log before springboot initialize" }
SpringApplication(MyApplication::class.java).run(*args)
log.info { "Log after springboot initialize" }
因此,Log before springboot initialize
被记录,之后什么都不发生(或者我找不到后续的日志)。
我已经验证了与logback设置无关,因为如果我从application.properties
中删除属性spring.cloud.azure.keyvault.secret.property-sources[0].endpoint
,它会正常启动。
(我还尝试添加了额外的依赖项spring-cloud-azure-dependencies:4.5.0
)
有关发生的情况以及如何解决的任何线索/提示吗?
谢谢。
英文:
I am trying to migrate my springboot application written in kotlin to azure.
I added spring-cloud-azure-starter-keyvault-secrets:4.5.0
dependency in my app, and added below configurations to application.properties
.
my.secret=${my-azure-secret}
spring.cloud.azure.keyvault.secret.property-source-enabled=true
spring.cloud.azure.keyvault.secret.property-sources[0].endpoint=<my-vault>.vault.azure.net/
After I add this, the spring boot initialization doesn't work any more and i can't find any logs.
log.info { "Log before springboot initialize" }
SpringApplication(MyApplication::class.java).run(*args)
log.info { "Log after springboot initialize" }
So, Log before springboot initialize
is logged, and after that nothing happens (or I can't find any logs afterwards)
I already verified it is not related to any logback settings because if I remove the property spring.cloud.azure.keyvault.secret.property-sources[0].endpoint
from application.properties
, it boots up properly.
(I also tried to add the additional dependency spring-cloud-azure-dependencies:4.5.0
)
Any clues/hints what is happening and how to resolve it ?
Thanks.
答案1
得分: 1
-
Here I was able to boot the spring application using the same dependencies.
-
But here I used the latest version of
spring-cloud-azure-starter-keyvault-secrets
i.e.5.0.0
also my spring boot version is3.0.2
my dependencies:
<dependencies>
<dependency> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency> <!-- https://mvnrepository.com/artifact/com.azure.spring/spring-cloud-azure-starter-keyvault-secrets -->
<dependency>
<groupId>com.azure.spring</groupId>
<artifactId>spring-cloud-azure-starter-keyvault-secrets</artifactId>
<version>5.0.0</version>
</dependency>
<dependency> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency></dependencies>
- Also I use windows so instead of
my_azure_secret
instead of themy-azure-secret
output:
英文:
-
Here I was able to boot the spring application using the same dependencies.
-
But here I used the latest version of
spring-cloud-azure-starter-keyvault-secrets
i.e.5.0.0
also my spring boot version is3.0.2
my dependencies:
<dependencies>
<dependency> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency> <!-- https://mvnrepository.com/artifact/com.azure.spring/spring-cloud-azure-starter-keyvault-secrets -->
<dependency>
<groupId>com.azure.spring</groupId>
<artifactId>spring-cloud-azure-starter-keyvault-secrets</artifactId>
<version>5.0.0</version>
</dependency>
<dependency> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency></dependencies>
- Also I use windows so instead of
my_azure_secret
instead of themy-azure-secret
output:
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论