The latest Maven plugin for Azure Web Apps provides a brand new experience that enables you to deploy not only application artifacts such as JAR, WAR, and EAR files but also application dependencies like libraries, module definitions, and startup scripts -- using one single Maven Goal.
mvn azure-webapp:deploy
Starting from version 1.16.1, the Maven plugin for Azure Web Apps now supports deploying extra file types like JAR, WAR, EAR, libraries, app server module definitions, startup scripts, and more. This new experience gives you:
The Maven plugin for Azure Web Apps greatly simplifies the development experience for Tomcat, Spring Boot, and JBoss EAP apps on Azure App Service. Starting from a Maven project, run the following config goal, follow the wizard to authenticate with Azure, and generate configurations in your pom.xml that are ready to deploy.
mvn com.microsoft.azure:azure-webapp-maven-plugin:1.16.1:config
<plugin>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-webapp-maven-plugin</artifactId>
<version>1.16.1</version>
<configuration>
<schemaVersion>v2</schemaVersion>
<subscriptionId>xxxxxx</subscriptionId>
<resourceGroup>xxx-rg</resourceGroup>
<appName>xxx</appName>
<pricingTier>P1v3</pricingTier>
<region>westeurope</region>
<appServicePlanName>asp-xxx</appServicePlanName>
<appServicePlanResourceGroup>xxx-rg</appServicePlanResourceGroup>
<runtime>
<os>Linux</os>
<javaVersion>Java 8</javaVersion>
<webContainer>Jbosseap 7.2</webContainer>
</runtime>
<deployment>
<resources>
<resource>
<directory>${project.basedir}/target</directory>
<includes>
<include>*.war</include>
</includes>
</resource>
</resources>
</deployment>
</configuration>
</plugin>
The above configuration includes only your build artifact. As demonstrated in the PetStore JBoss EAP sample app, you might need to upload a script containing extra steps to prepare the environment before running the artifact. Now, instead of uploading files to the Web App with FTP, deploying the WAR package, and triggering an app restart, you can simply add the configurations below in your pom.xml.
<deployment>
<resources>
<resource>
<type>war</type>
<directory>${project.basedir}/target</directory>
<includes>
<include>*.war</include>
</includes>
</resource>
<resource>
<type>lib</type>
<directory>${project.basedir}/.scripts/3B-mysql</directory>
<includes>
<include>*.jar</include>
</includes>
</resource>
<resource>
<type>startup</type>
<directory>${project.basedir}/.scripts/3B-mysql</directory>
<includes>
<include>*.sh</include>
</includes>
</resource>
<resource>
<type>script</type>
<directory>${project.basedir}/.scripts/3B-mysql</directory>
<includes>
<include>*.cli</include>
<include>*.xml</include>
</includes>
</resource>
</resources>
</deployment>
You can then deploy the app with one single command and everything is up and ready!
mvn package azure-webapp:deploy
Please do not hesitate to try it! Your feedback and suggestions are especially important to us and will help shape our product in future.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.