问题描述
使用Azure Spring Cloud服务,在部署时候失败,收到错误消息为:
c:projecthellospring>az spring-cloud app deploy -g dev -s testdemo -n demo -p ./hellospring-0.0.1-SNAPSHOT.jar This command usually takes minutes to run. Add '--verbose' parameter if needed. file_type is Jar [1/3] Requesting for upload URL [2/3] Uploading package to blob [3/3] Updating deployment in app 'demo' (this operation can take a while to complete) Deployment failed. Correlation ID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. 112404: Failed to wait for deployment instances to be ready. Please check the application log (see https://aka.ms/azure-spring-cloud-doc-log ), and try again later.
记录一下解决问题的步骤
分析问题
1)在新环境中再次部署,同一个hellospring-x.jar包,可以成功
2)回顾对Java代码的改动,发现改动了@Value("${message}"),把message消息改为资源文件。在注释掉@Value后,部署到Spring Cloud成功。
3)查看部署包中的资源文件,发现在里边是没有配置message属性。
4)在配置文件中添加相应的测试值再进行重新build 和发布,最终可以成功发布并访问到。
PS: 这次的错误提醒自己:遇见问题后,对比可以成功运行的改动是非常重要的定位点。