This example assumes you have previously completed the following examples:
- Create an Azure Resource Group
- Create an Azure Container Registry
- Build and push a Jetty container image to ACR
- Create settings.xml using admin access keys
- Create an Azure App Service Plan
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.
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 |
Do NOT forget to remove the resources once you are done running the example.
3m