Skip to content

Latest commit

 

History

History
104 lines (74 loc) · 2.78 KB

File metadata and controls

104 lines (74 loc) · 2.78 KB

Deploy a web application on a managed Tomcat

Prerequisites

This example assumes you have previously completed the following examples:

  1. Create an Azure Resource Group
  2. Create an Azure App Service Plan

Build the example

  mvn clean install

Deploy the web application on the managed Tomcat

Setup the application name environment variable using the command line below:

  export APPSERVICE_TOMCAT_HELLOWORLD=appservice-tomcat-helloworld-$RANDOM

To deploy the example use the following Maven command line:

  mvn azure-webapp:deploy \
    -DappName=$APPSERVICE_TOMCAT_HELLOWORLD \
    -DappServicePlan=$APPSERVICE_PLAN \
    -DresourceGroup=$RESOURCE_GROUP

Once the command completes you will be able to see the example by using your web browser and going to the xxxxx.azurewebsites.net address the command echoes.

You can also get the URL using the following command:

  az webapp show \
    --name $APPSERVICE_TOMCAT_HELLOWORLD \
    --resource-group $RESOURCE_GROUP \
    --query defaultHostName \
    --output tsv

Properties supported by the example

The example supports the following properties that you can pass in as -Dname=value to the Maven command line to customize your deployment.

name description
appName the Application Name
appServicePlan the App Service plan to use
javaVersion the Java version to use
region the Region to use
resourceGroup the Resource Group to use
webContainer the Web Container to use

Cleanup

Do NOT forget to remove the resources once you are done running the example.