Helidon 웹 애플리케이션을 Azure App Service에서 실행
Java의 웹 프레임 워크는 여러 가지가 있으므로 다른 것은 어떨까 ...? 라고 신경이 쓰였으므로, 오늘은 MicroProfile의 「Helidon」을 시험해 보았습니다.
기본적으로는 Microsoft가 후회하고 있는 이하의 문서대로의 순서입니다만, 일부 변경하지 않으면 잘 움직이지 않았으므로, 그 주변을 포함해 정리합니다.
로컬 환경에서 실행
어제 쓴 기사 과 같은 이하의 환경을 사용했습니다.
Visual Studio Code
사용한 dockerfile은 다음과 같습니다.
FROM maven:3.8.1-openjdk-11
RUN curl -sL https://aka.ms/InstallAzureCLIDeb | bash
먼저 MicroProfile Starter 에서 다음과 같이 선택하여 Helidon 프로젝트를 다운로드합니다.

압축이 풀린 것을 컨테이너 환경에서 열고 다음 명령을 실행합니다.
mvn clean package
나머지는 실행하기만 하면 됩니다.
java -jar target/demo.jar
브라우저로 접속하면 아래와 같은 화면이 됩니다.

클릭하면 Hello World가 표시됩니다.

여기까지는 문서대로입니다.
Azure에서 실행
그런 다음 Azure에 배포할 준비입니다. 먼저 Azure CLI로 로그인합니다.
az login
그런 다음 pom.xml의 섹션에 다음을 추가합니다. 문서 그럼 1.10.0이 되어 있습니다만, 시도하면 잘 움직이지 않았습니다. 본 기사의 작성 시점의 최신인 1.13.0으로 했는데 잘 되었으므로, 이하를 추가합니다.
<build>
<finalName>helidon-hello-azure</finalName>
<plugins>
<plugin>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-webapp-maven-plugin</artifactId>
<version>1.13.0</version>
</plugin>
</plugins>
</build>
그런 다음 azure-webapp에서 Azure 구성을 설정합니다.
mvn azure-webapp:config
대화식으로 구성을 듣기 때문에 리눅스, 자바 11을 선택했습니다. 이후 문서 에서는 섹션을 편집합니다만, 그대로 적용하면 잘 되지 않았습니다.
azure-webapp-maven-plugin을 1.10.0이 아닌 1.13.0으로 올린 것으로 구성에서 사용할 수없는 정의가있는 것 같습니다.
그래서 태그에서 "java11"로 지정한 것을 "Java SE"로 변경했습니다.
또, 문서에서는 태그로 「/libs/*.jar」를 추가하고 있습니다만, 이것이 있으면
Multi executable jars found in <resources>, please check the configuration
라고 하는 에러가 되기 때문에 컷 했습니다. 그래서 최종 정의는 다음과 같습니다.
<plugins>
<plugin>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-webapp-maven-plugin</artifactId>
<version>1.13.0</version>
<configuration>
<schemaVersion>V2</schemaVersion>
<resourceGroup>demo-xxxxxxxxx-rg</resourceGroup>
<appName>demo-xxxxxxxxxxxx</appName>
<pricingTier>P1v2</pricingTier>
<region>westeurope</region>
<runtime>
<os>linux</os>
<javaVersion>java11</javaVersion>
<webContainer>Java SE</webContainer>
</runtime>
<appSettings>
<property>
<name>PORT</name>
<value>8080</value>
</property>
<property>
<name>WEBSITES_PORT</name>
<value>8080</value>
</property>
<property>
<name>WEBSITES_CONTAINER_START_TIME_LIMIT</name>
<value>600</value>
</property>
</appSettings>
<deployment>
<resources>
<resource>
<directory>${project.basedir}/target</directory>
<includes>
<include>*.jar</include>
</includes>
</resource>
</resources>
</deployment>
</configuration>
</plugin>
</plugins>
그리고는 이하 배포하면 종료입니다.
mvn clean package
mvn azure-webapp:deploy
배포된 웹 애플리케이션에 액세스할 때 로컬 환경과 동일한 것이 무사히 표시되었습니다.


문서대로 시험해 에러가 나왔을 때에 조금 초조합니다만, 그 만큼, 잘 움직였을 때는 기쁘네요. 다른 프레임워크도 시도하고 싶습니다.
Reference
이 문제에 관하여(Helidon 웹 애플리케이션을 Azure App Service에서 실행), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://qiita.com/kikutaro/items/cb92d6d5b2c8e22c8427
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)
az login
<build>
<finalName>helidon-hello-azure</finalName>
<plugins>
<plugin>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-webapp-maven-plugin</artifactId>
<version>1.13.0</version>
</plugin>
</plugins>
</build>
mvn azure-webapp:config
또, 문서에서는
Multi executable jars found in <resources>, please check the configuration
라고 하는 에러가 되기 때문에 컷 했습니다. 그래서 최종 정의는 다음과 같습니다.
<plugins>
<plugin>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-webapp-maven-plugin</artifactId>
<version>1.13.0</version>
<configuration>
<schemaVersion>V2</schemaVersion>
<resourceGroup>demo-xxxxxxxxx-rg</resourceGroup>
<appName>demo-xxxxxxxxxxxx</appName>
<pricingTier>P1v2</pricingTier>
<region>westeurope</region>
<runtime>
<os>linux</os>
<javaVersion>java11</javaVersion>
<webContainer>Java SE</webContainer>
</runtime>
<appSettings>
<property>
<name>PORT</name>
<value>8080</value>
</property>
<property>
<name>WEBSITES_PORT</name>
<value>8080</value>
</property>
<property>
<name>WEBSITES_CONTAINER_START_TIME_LIMIT</name>
<value>600</value>
</property>
</appSettings>
<deployment>
<resources>
<resource>
<directory>${project.basedir}/target</directory>
<includes>
<include>*.jar</include>
</includes>
</resource>
</resources>
</deployment>
</configuration>
</plugin>
</plugins>
그리고는 이하 배포하면 종료입니다.
mvn clean package
mvn azure-webapp:deploy
배포된 웹 애플리케이션에 액세스할 때 로컬 환경과 동일한 것이 무사히 표시되었습니다.


문서대로 시험해 에러가 나왔을 때에 조금 초조합니다만, 그 만큼, 잘 움직였을 때는 기쁘네요. 다른 프레임워크도 시도하고 싶습니다.
Reference
이 문제에 관하여(Helidon 웹 애플리케이션을 Azure App Service에서 실행), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/kikutaro/items/cb92d6d5b2c8e22c8427텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)