Blog Post

Apps on Azure Blog
3 MIN READ

Simplify Full-stack Java Development with JHipster Online, Terraform and Bicep

Hang_Wang's avatar
Hang_Wang
Icon for Microsoft rankMicrosoft
Dec 23, 2024

Generate a full-stack Java project using JHipster Online, no local setup needed. Deploy the project easily with Terraform or Bicep in just a few steps.

In the previous blog: Build and deploy full-stack Java Web Applications on Azure Container Apps with JHipster, we explored the fundamental features of JHipster Azure Container Apps. Specifically, we demonstrated how to create and deploy a project to Azure Container Apps in just a few steps.

In this blog, we will introduce some new features in JHipster Azure Container Apps, which make project creation even simpler and deployment more seamless.

JHipster Online: Quick Prototyping Made Easy

JHipster Online is a quick prototyping website that allows you to generate a full-stack Spring Boot project without requiring any installation! You can start building your Azure project by clicking the Create Azure Application button.

🌟Generate the project

Simply answer a few guided questions, and JHipster Online will generate a project ready for building and deployment.

In the final step of the questionnaire, you can choose to generate either a Terraform or Bicep file for deployment. If you prefer using the CLI version, install it with the following command:

npm install -g generator-jhipster-azure-container-apps

You can run create the project with:

jhipster-azure-container-apps

🚀Deploy the project

💚Terraform

Terraform is an infrastructure-as-code (IaC) tool that allows you to build, modify, and version cloud and on-premises resources securely and efficiently. It supports a wide range of popular cloud providers, including AWS, Azure, Google Cloud Platform (GCP), Oracle Cloud Infrastructure (OCI), and Docker.

To deploy using Terraform, ensure that Terraform is selected during the project generation step. Additionally, you must have Terraform installed and properly configured.

After generating the project, navigate to the Terraform folder:

cd terraform

Initialize Terraform by running the following command:

terraform init

Once finished, privision the necessary resource on Azure with:

terraform apply -auto-approve

Now you can deploy the project with:

  • Linux/MacOS: 
    .\deploy.sh
    You can run the deployment script by adding options subId, region and resourceGroupName.
  • Windows: 
    .\deploy.ps1
    You will be prompted to provide subId, region, and resourceGroupName.

❤️Bicep

Bicep is a domain-specific language that uses declarative syntax to deploy Azure resources.

In order to deploy with Terraform, make sure you select Bicep in the project generation step. You may also need to have Azure CLI installed and configured.

Once the project has been created, change into the Bicep folder:

cd bicep

Setup bicep with:

az deployment sub create -f ./main.bicep --location=eastus2 --name jhipster-aca --only-show-errors

Here you can replace the location and the name parameters with your own choices.

Now you can deploy the project with:

  • Linux/MacOS:
    .\deploy.sh

     

     You can run the deployment script by adding options subId, region and resourceGroupName.
  • Windows: 
    .\deploy.ps1
    You will be prompted to provide subId, region, and resourceGroupName.

💛 Deploy from Source Code, Artifact and more

In addition to the options mentioned, Azure Container Apps provides a wide range of deployment methods designed to suit diverse project needs.

Whether you prefer deploying directly from source code, pre-built artifacts, or container images, Azure Container Apps streamlines the entire process with its robust built-in Java support. This enables developers to focus on innovation rather than infrastructure management.

From integrating with popular CI/CD pipelines to leveraging advanced deployment techniques like Github, Azure Container Apps offers the flexibility to match your workflow. Discover how to effortlessly deploy and scale your project by visiting: Launch your first Java application in Azure Container Apps.

Updated Dec 16, 2024
Version 1.0
No CommentsBe the first to comment