Skip to content

Latest commit

 

History

History
107 lines (78 loc) · 3.2 KB

File metadata and controls

107 lines (78 loc) · 3.2 KB

Deploy Glassfish using a container image

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 Glassfish container image to ACR
  4. Create settings.xml using admin access keys
  5. Create an Azure App Service Plan

Deploy Glassfish using a container image

To deploy Glassfish use the following command lines:

  export APPSERVICE_CONTAINER_GLASSFISH=appservice-container-glassfish-$RANDOM

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

  az webapp show \
    --resource-group $RESOURCE_GROUP \
    --name $APPSERVICE_CONTAINER_GLASSFISH \
    --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 Glassfish 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 container 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