azure - 无法在 Azure 中部署 Spring Boot 应用程序

标签 azure spring-boot azure-web-app-service azure-java-tools

我正在尝试在Azure中部署Spring boot应用程序,并且我按照微软官方文档https://learn.microsoft.com/en-us/azure/java/spring-framework/deploy-spring-boot-java-app-with-maven-plugin中提到的确切步骤进行操作。 。但即使在命令行中成功登录 azure 后,我仍收到错误消息。

The refresh token has expired due to maximum lifetime. The token was issued on 2019-11-25T00:18:57.5736076Z and the maximum allowed lifetime for this application is 08:00:00 atcom.microsoft.aad.adal4j.AdalTokenRequest.executeOAuthRequestAndProcessResponse (AdalTokenRequest.java:128) at com.microsoft.aad.adal4j.AuthenticationContext.acquireTokenCommon (AuthenticationContext.java:928) at com.microsoft.aad.adal4j.AcquireTokenCallable.execute (AcquireTokenCallable.java:70) at com.microsoft.aad.adal4j.AcquireTokenCallable.execute (AcquireTokenCallable.java:38) at com.microsoft.aad.adal4j.AdalCallable.call (AdalCallable.java:47) at java.util.concurrent.FutureTask.run (FutureTask.java:264) at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1128) at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:628) at java.lang.Thread.run (Thread.java:835)

最佳答案

如错误消息所示,您的 token 已过期。这里有三个建议:

  1. 如果您使用 Azure CLI 登录,请使用“az login”刷新 token 。
  2. 检查文件 %HOMEPATH%/.azure/azure-secret.json,这是 azure-maven-plugin 创建的 auth 文件,具有更高的 优先级高于 Azure CLI 身份验证文件。如果该文件存在,您可以 删除文件(将使用 az 登录)或使用“mvn com.microsoft.azure:azure-maven-plugin:0.1.0:登录”。
  3. 如果以上都不起作用,您仍然可以尝试使用服务原理进行身份验证。请参阅https://github.com/microsoft/azure-maven-plugins/wiki/Authentication了解详情。

关于azure - 无法在 Azure 中部署 Spring Boot 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59435415/

相关文章:

Azure Web应用程序安全组访问

java - 如何修复 "Exception in thread "main"java.lang.NoClassDefFoundError : org/springframework/core/io/support/SpringFactoriesLoader"in Spring Tool Suite

azure - 如何通过IP地址阻止对子域的访问

azure - 加密 azure webapp 的连接字符串

azure - 在没有 azure 门户的情况下启动 azure 虚拟机

java - @Conditional on bean 初始化

java - Spring 集成测试 : inject @Value while using MockitoJUnitRunner

c# - 从 Azure 主题接收消息产生 null,主题有未读消息

azure - Azure Synapse Analytics 中的专用 sql 池和专用 sql 池之间的区别?

linux - 如何使用 Azure 为资源管理器 VM 提供的 DNS?