microsoft / azure-maven-plugins

Maven plugins for Azure
MIT License
276 stars 150 forks source link

V1 zip deployment type, the URL can't access #632

Closed sallyur closed 5 years ago

sallyur commented 5 years ago

Plugin name and version

Maven plugin for Azure web apps 1.6.0

Plugin configuration in your pom.xml

Take Linux as an example:

<?xml version="1.0" encoding="UTF-8"?>

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.1.2.RELEASE</version>
        <relativePath/>
        <!-- lookup parent from repository -->
    </parent>
    <groupId>com.microsoft.azure</groupId>
    <artifactId>springbootdemo</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>springbootdemo</name>
    <description>Demo project for Spring Boot</description>
    <properties>
        <java.version>1.8</java.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <pluginRepositories> 
<pluginRepository> 
<id>commicrosoftazure-3083</id> 
<name>commicrosoftazure-3083</name> 
<url>https://oss.sonatype.org/content/repositories/commicrosoftazure-3083/</url> 
</pluginRepository> 
</pluginRepositories>  
    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>com.microsoft.azure</groupId>
                    <artifactId>azure-webapp-maven-plugin</artifactId>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>com.microsoft.azure</groupId>
                <artifactId>azure-webapp-maven-plugin</artifactId>
                <version>1.6.0</version>
                <configuration>
                    <deploymentType>zip</deploymentType>
                    <authentication>
                        <serverId>azure-auth</serverId>
                    </authentication>
                    <resourceGroup>your-resource-group</resourceGroup>
                    <appName>your-app-name</appName>
                    <region>westeurope</region>
                      <linuxRuntime>jre8</linuxRuntime>  

                    <stopAppDuringDeployment>true</stopAppDuringDeployment>
                    <resources>
                        <resource>
                            <directory>${project.basedir}/target</directory>
                            <targetPath>/</targetPath>
                            <includes>
                                <include>*.jar</include>
                            </includes>
                        </resource>

                    </resources>
                     <appSettings>
                  <property>
                     <name>PORT</name>
                     <value>8080</value>
                  </property>
                </appSettings>  
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

Expected behavior

The URL can access

Actual behavior

The URL can't access: Windows: image Linux: image It works fine if I set the deployment type to jar

Steps to reproduce the problem

  1. Prepare a webapp maven project with neweast maven plugin version
  2. Set the pom file as above
  3. Run "mvn clean package"
  4. Run "mvn azure-webapp:deploy"
sallyur commented 5 years ago

For V1 Windows web app, if the deployment type is jar, don't need to set web.config, but need to set web.config for other deployments type For V1 Linux web app, if the deployment type is jar, don't need to rename java file as app.jar only need to set port 8080, but need to rename java file as app.jar and set port 8080, for other deployments type For V2, Windows web app should be able to run directory, Linux web app just needs to add port attributes, no need to manually rename app.jar So this issue is expected, close it.