microsoft / azure-maven-plugins

Maven plugins for Azure
MIT License
272 stars 140 forks source link

Unable to deploy from devcontainer #2427

Open vermegi opened 4 months ago

vermegi commented 4 months ago

Plugin name and version

I ran through the steps from https://learn.microsoft.com/en-us/azure/app-service/quickstart-java?pivots=java-maven-tomcat and tried with both mvn com.microsoft.azure:azure-webapp-maven-plugin:2.12.0:config and mvn com.microsoft.azure:azure-webapp-maven-plugin:2.13.0:config

Plugin configuration in your pom.xml

        <plugin>
            <groupId>com.microsoft.azure</groupId>
            <artifactId>azure-webapp-maven-plugin</artifactId>
            <version>2.13.0</version>
            <configuration>
                <schemaVersion>v2</schemaVersion>
                <resourceGroup>msal4j-servlet-auth-1707140060326-rg</resourceGroup>
                <appName>msal4j-servlet-auth-1707140060326</appName>
                <pricingTier>P1v2</pricingTier>
                <region>swedencentral</region>
                <runtime>
                    <os>Linux</os>
                    <javaVersion>Java 17</javaVersion>
                    <webContainer>Tomcat 10.0</webContainer>
                </runtime>
                <deployment>
                    <resources>
                        <resource>
                            <directory>${project.basedir}/target</directory>
                            <includes>
                                <include>*.war</include>
                            </includes>
                        </resource>
                    </resources>
                </deployment>
            </configuration>
        </plugin>

Expected behavior

Deploy to app service

Actual behavior

[INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 18.491 s [INFO] Finished at: 2024-02-05T13:45:16Z [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal com.microsoft.azure:azure-webapp-maven-plugin:2.13.0:deploy (default-cli) on project msal4j-servlet-auth: login with (AUTO): UnsatisfiedLinkError: /usr/lib/jvm/msopenjdk-current/lib/libawt_xawt.so: libXext.so.6: cannot open shared object file: No such file or directory -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

Steps to reproduce the problem

I executed exactly the same steps in a cloud shell and deploy was successful.

So somewhere/somehow this is failing when executed from a devcontainer. I also tried different Java versions/base container image versions, all failed on the same error.

vermegi commented 4 months ago

Additionaly, I tested if signing in with Azure Account Extension in VS code would fix the problem. But it's giving me the same error. In previous tests I signed in through az login command.