This tutorial shows you how to deploy a Hilla application to Microsoft’s Azure cloud. Azure offers a 30-day free trial that includes 12 months of free commercial services. You can find details of their free and commercial services from the Azure website.
Azure account requiredTo complete this tutorial, you need an Azure account. You can sign up at https://signup.azure.com/.
You can find installation instructions for different platforms in the Azure CLI documentation.
Download a minimal Hilla project and unpack the downloaded zip into a folder on your computer.
npx @hilla/cli init my-app
pom.xml file and add the following section in the
<plugins> tag in the
<plugin> <groupId>com.microsoft.azure</groupId> <artifactId>azure-webapp-maven-plugin</artifactId> <version>2.2.3</version> </plugin>
Open the project directory from a terminal window, and enter the following command to generate a
JAR file of your application:
mvn package -Pproduction
From the terminal window, enter the following command:
This command authenticates you with Azure via the browser, assuming you aren’t already logged in with the Azure CLI. You are then prompted with certain options. You can select the following:
<create> when asked to choose a Java SE Web App.
Linux when asked to choose an OS.
Java 11 for the Java version
F1 for the pricingTier
Enter Y on your keyboard to confirm
Enter the following command to deploy your app:
You might be required to authenticate again in the browser. Once authenticated, your application is deployed to Azure and you should see your application URL in the logs as in the following screenshot.