Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring boot 将示例springboot应用程序(WebGoat)部署到Azure应用程序服务_Spring Boot_Azure_Azure Web App Service_Spring Boot Maven Plugin_Azure Java Tools - Fatal编程技术网

Spring boot 将示例springboot应用程序(WebGoat)部署到Azure应用程序服务

Spring boot 将示例springboot应用程序(WebGoat)部署到Azure应用程序服务,spring-boot,azure,azure-web-app-service,spring-boot-maven-plugin,azure-java-tools,Spring Boot,Azure,Azure Web App Service,Spring Boot Maven Plugin,Azure Java Tools,Azure应用程序服务新手,下面,我正在尝试将WebGoat部署到Azure应用程序,但没有成功 git clone https://github.com/WebGoat/WebGoat cd WebGoat git checkout v8.0.0.M26 mvn install -T 4 -Dmaven.test.skip=true -DskipTests cd webgoat-server //here I could deploy the jar locally with //$jav

Azure应用程序服务新手,下面,我正在尝试将WebGoat部署到Azure应用程序,但没有成功

git clone https://github.com/WebGoat/WebGoat
cd WebGoat
git checkout v8.0.0.M26
mvn install -T 4 -Dmaven.test.skip=true -DskipTests
cd webgoat-server

//here I could deploy the jar locally with 
//$java -jar target/webgoat-server-v8.0.0.M26.jar
//and see the site at localhost:8080/WebGoat

//now trying to deploy to azure using Azure maven plguin
mvn com.microsoft.azure:azure-webapp-maven-plugin:1.14.0:config
vim pom.xml //as per below
mvn package azure-webapp:deploy
我的webgoat服务器/pom.xml

     <plugin>
        <groupId>com.microsoft.azure</groupId>
        <artifactId>azure-webapp-maven-plugin</artifactId>
        <version>1.14.0</version>
        <configuration>
          <schemaVersion>v2</schemaVersion>
          <subscriptionId>0665bd88-599e-4153-887a-2c51c3e094d0</subscriptionId>
          <resourceGroup>webgoat-server-1620910221297-rg</resourceGroup>
          <appName>webgoat-server-1620910221297</appName>
          <pricingTier>F1</pricingTier>
          <region>westeurope</region>
          <runtime>
            <os>Linux</os>
            <javaVersion>Java 11</javaVersion>
            <webContainer>Java SE</webContainer>
          </runtime>
          <deployment>
            <resources>
              <resource>
                <directory>${project.basedir}/target</directory>
                <includes>
                  <include>webgoat-server-v8.0.0.M26.jar</include>
                </includes>
              </resource>
            </resources>
          </deployment>
        </configuration>
从浏览器

导航到

导航到


是否需要其他步骤来公开端口8080和path/WebGoat?

要在应用程序服务上公开端口8080,请参阅


至于路径,您应该在
site/home/wwwroot
下安装应用程序。检查配置->路径映射以查看虚拟目录。

@bloackingHD,谢谢。我在我的应用程序设置中添加了/8080密钥对;我不了解路径映射部分。my Azure应用程序中的路径映射为空;如何将应用程序安装到site/home/wwroot?通过SSH登录,我发现我的应用程序当前安装在/home/site/wwwroot/app.jar
2021-05-13T13:03:30.937769935Z: [INFO]  2021-05-13 13:03:30.937  INFO 124 --- [           main] o.s.s.concurrent.ThreadPoolTaskExecutor  : Initializing ExecutorService 'applicationTaskExecutor'
2021-05-13T13:03:33.564912852Z: [INFO]  2021-05-13 13:03:33.564  INFO 124 --- [           main] o.s.b.a.e.web.EndpointLinksResolver      : Exposing 2 endpoint(s) beneath base path '/actuator'
2021-05-13T13:03:34.138847510Z: [INFO]  2021-05-13 13:03:34.138  INFO 124 --- [           main] io.undertow                              : starting server: Undertow - 2.0.27.Final
2021-05-13T13:03:34.205034948Z: [INFO]  2021-05-13 13:03:34.204  INFO 124 --- [           main] org.xnio                                 : XNIO version 3.3.8.Final
2021-05-13T13:03:34.295912450Z: [INFO]  2021-05-13 13:03:34.295  INFO 124 --- [           main] org.xnio.nio                             : XNIO NIO Implementation Version 3.3.8.Final
2021-05-13T13:03:34.383176472Z: [ERROR]  WARNING: An illegal reflective access operation has occurred
2021-05-13T13:03:34.383264172Z: [ERROR]  WARNING: Illegal reflective access by org.xnio.nio.NioXnio$2 (jar:file:/local/site/wwwroot/app.jar!/BOOT-INF/lib/xnio-nio-3.3.8.Final.jar!/) to constructor sun.nio.ch.EPollSelectorProvider()
2021-05-13T13:03:34.383276972Z: [ERROR]  WARNING: Please consider reporting this to the maintainers of org.xnio.nio.NioXnio$2
2021-05-13T13:03:34.383281572Z: [ERROR]  WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
2021-05-13T13:03:34.384696864Z: [ERROR]  WARNING: All illegal access operations will be denied in a future release
2021-05-13T13:03:36.058791199Z: [INFO]  2021-05-13 13:03:36.058  INFO 124 --- [           main] o.s.b.w.e.u.UndertowServletWebServer     : Undertow started on port(s) 80 (http) with context path '/WebGoat'
2021-05-13T13:03:36.159459348Z: [INFO]  2021-05-13 13:03:36.158  INFO 124 --- [           main] org.owasp.webgoat.StartWebGoat           : Started StartWebGoat in 90.144 seconds (JVM running for 106.368)
2021-05-13T13:05:29  No new trace in the past 1 min(s).
2021-05-13T13:06:29  No new trace in the past 2 min(s).
2021-05-13T13:07:29  No new trace in the past 3 min(s).
502 - Web server received an invalid response while acting as a gateway or proxy server.
There is a problem with the page you are looking for, and it cannot be displayed. When the Web server (while acting as a gateway or proxy) contacted the upstream content server, it received an invalid response from the content server.
:( Application Error
If you are the application administrator, you can access the diagnostic resources.