2016-08-23 7 views
1

Azure App Service에 springboot 프로젝트를 배포하려고합니다. App Service를 만들고 FTP를 통해 두 개의 파일 (test.war 및 web.config)을 업로드했습니다.Azure App 서비스에 Springboot 배포

I 사이트/wwwroot에로 전쟁 파일을 업로드뿐만 아니라이 web.config 파일을 배치하고있어

<?xml version="1.0" encoding="UTF-8"?> 
<configuration> 
    <system.webServer> 
    <handlers> 
     <add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" /> 
    </handlers> 
    <httpPlatform processPath="%JAVA_HOME%\bin\java.exe" 
     arguments="-Djava.net.preferIPv4Stack=true -Dserver.port=%HTTP_PLATFORM_PORT% -jar &quot;%HOME%\site\wwwroot\test.war&quot;"> 
    </httpPlatform> 
    </system.webServer> 
</configuration> 

의 Web.config.

제 질문은 : 어떻게 war 파일을 실행합니까? 자동으로 배포가 완료되면 어떻게됩니까? 내가 할 모든 서비스를 사용할 수 없음, HTTP 오류입니다 지금의 원인 (503)

감사

답변

2

@ItaiSoudry, 당신의 web.config 파일의 내용에 따르면, 당신이 포함 된 바람둥이 나 같은 임베디드 서블릿 컨테이너를 사용하려는 것으로 보인다 부두가 봄 부팅 웹 응용 프로그램을 시작합니다.

사용하는 IDE가 Eclipse라고 가정하면 war 부트 파일이 아닌 실행 가능한 jar 파일로 스프링 부트 프로젝트를 내 보내야합니다. 아래 그림을 참조하십시오.

enter image description here

enter image description here

참고 : Launch configuration 메인 함수 SpringApplication.run를 포함하는 클래스가 선택되어야한다.

한편, 당신은 web.config 파일에 %HTTP_PLATFORM_PORT%와 인수 --server.port=%HTTP_PLATFORM_PORT%를 통해 지원되는 푸른 앱 서비스를 청취 포트를 구성하거나 값 System.getenv("HTTP_PLATFORM_PORT")와 클래스 ServerProperties의 포트를 설정해야합니다.

여기에 web.config에 대한 샘플은 --server.port=%HTTP_PLATFORM_PORT%입니다. 당신이 war 파일을 배포 할 경우

<?xml version="1.0" encoding="UTF-8"?> 
<configuration> 
    <system.webServer> 
    <handlers> 
     <add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" /> 
    </handlers> 
    <httpPlatform processPath="%JAVA_HOME%\bin\java.exe" 
     arguments="-Djava.net.preferIPv4Stack=true -Dserver.port=%HTTP_PLATFORM_PORT% -jar &quot;%HOME%\site\wwwroot\test.jar&quot;"> 
    </httpPlatform> 
    </system.webServer> 
</configuration> 

, 당신은 다음, 푸른 포털 앱 서비스의 ApplicationSettings를 구성 경로 wwwroot/webapps에 전쟁 파일을 업로드해야합니다. 참조로

enter image description here

, 아래의 문서를 참조하십시오.

https://azure.microsoft.com/en-us/documentation/articles/web-sites-java-custom-upload/#application-configuration-examples

  • Create a Java web app in Azure App Service는 희망이 도움이 기사에 Springboot 하위 섹션.