A supported Java Development Kit (JDK). For more information about the JDKs available for use when developing on Azure, see Java support on Azure and Azure Stack.
Then you can configure the deployment. Run the following Maven command:
mvn azure-webapp:config
Select the following options when prompted:
Input Field
Input/Select Value
Define value for OS(Default: Linux):
1. linux
Define value for javaVersion(Default: Java 8):
2. Java 8
Confirm (Y/N)
y
This command produces output similar to the following example:
[INFO] Scanning for projects...
[INFO]
[INFO] ----< com.microsoft.azure.samples.kumuluzee:kumuluzEE-hello-azure >-----
[INFO] Building kumuluzEE-hello-azure 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- azure-webapp-maven-plugin:1.10.0:config (default-cli) @ kumuluzEE-hello-azure ---
1. linux [*]
2. windows
3. docker
Enter index to use: 1
Define value for javaVersion(Default: Java 8):
1. Java 11
2. Java 8 [*]
Enter index to use: 2
Please confirm webapp properties
AppName : kumuluzEE-hello-azure-1601006602397
ResourceGroup : kumuluzEE-hello-azure-1601006602397-rg
Region : westeurope
PricingTier : PremiumV2_P1v2
OS : Linux
RuntimeStack : JAVA 8-jre8
Deploy to slot : false
Confirm (Y/N)? : y
[INFO] Saving configuration to pom.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 44.223 s
[INFO] Finished at: 2020-09-25T13:04:02+09:00
[INFO] ------------------------------------------------------------------------
Add the <appSettings> section to the <configuration> section of PORT, WEBSITES_PORT, and WEBSITES_CONTAINER_START_TIME_LIMIT. Your XML entry for azure-webapp-maven-plugin will look similar to the following example:
After you've configured all of the settings in the preceding sections of this article, you're ready to deploy your web app to Azure. To do so, use the following steps:
From the command prompt or terminal window that you were using earlier, rebuild the JAR file using Maven if you made any changes to the pom.xml file; for example:
mvn clean package
Deploy your web app to Azure by using Maven; for example:
mvn azure-webapp:deploy
If the deployment succeeded, you'll see the following output.
[INFO] Successfully deployed the artifact to https://kumuluzee-hello-azure-1601006602397.azurewebsites.net
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:23 min
[INFO] Finished at: 2020-09-25T13:13:14+09:00
[INFO] ------------------------------------------------------------------------
Maven will deploy your web app to Azure. If the web app or web app plan doesn't already exist, it will be created for you. It might take a few minutes before the web app is visible at the URL shown in the output. Navigate to the URL in a Web browser. You should see the following screen.
When your web has been deployed, you can manage it through the Azure portal.
Your web app will be listed in the microprofile resource group.
You can access to your web app by selecting Browse on the Overview page for your web app. Verify that the deployment was successful and Running.
Confirm the log stream from the running App Service
You can see (or "tail") the logs from the running App Service. Any calls to console.log in the site code are displayed in the terminal.
az webapp log tail \
--resource-group microprofile \
--name kumuluzEE-hello-azure-1601006602397
Clean up resources
When the Azure resources are no longer needed, clean up the resources you deployed by deleting the resource group.
From the Azure portal, select Resource group from the left menu.
Enter microprofile in the Filter by name field, the resource group created in this tutorial should have this prefix.
Select the resource group created in this tutorial.
Select Delete resource group from the top menu.
Next steps
To learn more about MicroProfile and Azure, continue to the MicroProfile on Azure documentation center.
Build end-to-end solutions in Microsoft Azure to create Azure Functions, implement and manage web apps, develop solutions utilizing Azure storage, and more.