Skip to content

Latest commit

 

History

History
106 lines (77 loc) · 3.36 KB

File metadata and controls

106 lines (77 loc) · 3.36 KB

Deploy Jetty using a container image

appservice/container-jetty/README.md

Prerequisites

This example assumes you have previously completed the following examples:

  1. Create an Azure Resource Group
  2. Create an Azure Container Registry
  3. Build and push a Jetty container image to ACR
  4. Create settings.xml using admin access keys
  5. Create an Azure App Service Plan

Deploy Jetty using a Docker image

To deploy Jetty use the following command lines:

  export APPSERVICE_CONTAINER_JETTY=appservice-container-jetty-$RANDOM

  mvn azure-webapp:deploy \
    --settings=$SETTINGS_XML \
    -DappName=$APPSERVICE_CONTAINER_JETTY \
    -DimageName=$ACR_JETTY_IMAGE \
    -DappServicePlan=$APPSERVICE_PLAN \
    -DresourceGroup=$RESOURCE_GROUP \
    -DserverId=$ACR_NAME

  az webapp show \
    --resource-group $RESOURCE_GROUP \
    --name $APPSERVICE_CONTAINER_JETTY \
    --query 'hostNames[0]' \
    --output tsv

Then open your browser to the URL shown as output and you should see:

And this is served by a custom Jetty using a Docker image coming from our 
own Azure Container Registry.

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
imageName the Docker image name
registry the Azure Container Registry name
registryUrl the Azure Container Registry url
resourceGroup the Azure Resource Group name
serverId the Maven server id

Cleanup

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

3m