Microsoft Azure is a great destination for Java applications, and our goal is to help Java developers easily onboard their applications to Azure.
We understand that onboarding Java apps to Azure is not only about deploying Java apps but also includes the provisioning of dependent services like databases, messaging services as well as compute services like Azure Kubernetes Service, Azure Application Service, Azure Container Apps, etc. Java developers new to Azure often use either the Azure CLI or the Azure Portal to provision necessary Azure services. This requires learning many different CLI commands, different Portal experiences, and even different infrastructure-as code languages such as Bicep or Terraform.
As my colleague Julia Muiruri wrote last week, Azure Developer CLI (AZD) helps developers quickly and efficiently onboard their applications to Azure. Today we are announcing the private preview of a set of new features designed specifically for Java developers. These features are implemented in the AZD CLI and exposed via a Visual Studio Code extension. Register now to try out these features and provide feedback.
The new features in AZD simplify Azure onboarding for Java developers by providing a solution that requires only 2 steps to provision and deploy your application to Azure.
New Java features in AZD
This diagram illustrates the new features in AZD that simplify the developer experience for provisioning and deploying Java applications to Azure:
- Open your existing Java project in your preferred IDE.
- If you are using Maven, right click (the 1st click) on the root pom.xml and choose “generate Azure deployment scripts”. Our tools will generate azure.yaml which declares all the necessary Azure services for your Java project and any connection information your Java application needs to connect to Azure services (such as a database or a messaging service).
- Next, right click (the 2nd click) on azure.yaml and select “deploy to Azure”. As a result, all required Azure services will be provisioned automatically and your Java application will be deployed to the appropriate Azure compute service.
To achieve this simplicity, AZD offers these key capabilities:
- An application-centric azure.yaml as the source definition to describe your application. There is no need to use different CLI commands, Bicep or Terraform scripts.
- Generate azure.yaml from any existing Java repository. You don’t need to write azure.yaml since AZD can analyze your Java project to auto detect resources and bindings between applications and dependent services.
- AZD will generate the necessary Bicep files from azure.yaml. If you need to view the Bicep files, AZD will synthesize these files for you to review.
Getting started
Let’s look at how to deploy a simple Spring application to Azure. The sample application is a to-do list management app, composed of three microservices: web, api and email services. When a user adds or updates a to-do item on the web page, the to-do item will be stored into MongoDB by the api service. For to-do items that are “due”, the api service will send messages into Azure Service Bus. These messages will be consumed by email service to send an email to you. This diagram shows the overall architecture and interaction relationship among the three services and their backing Azure services: MongoDB and Azure Service Bus.
Putting it all together, to deploy this Spring application to Azure we need to:
- Provision Azure Cosmos DB for Mongo API.
- Provision Azure Service Bus.
- Provision the compute service to run the app, such as Azure Container Apps
- Deploy all three microservices onto the compute service with correct bindings to the DB or message service.
Now let’s see how to do all this with just 2 clicks:
- Open VS code with this Spring project.
- Right click on the root pom.xml and choose “Generate Azure deployment Script”.
- azure.yaml will be generated under the root path with all necessary deployment artifacts declared inside.
- Right click on the azure.yaml and choose “Package, Provision and Deploy (up)” to trigger the overall provisioning and deployment.
- After deployment, you’ll see your dedicated resource group in the Azure Portal. In the resource group, you’ll see:
- Mongo DB: provisioned as Azure Cosmos DB service and running
- Azure Service Bus: provisioned as Azure Service Bus and running
- 3 Apps: deployed as Azure Container Apps all running inside a single Azure Container App environment.
How to enroll in the private preview
Are you a Java developer new to Azure and looking onboard your project or your team’s? Do you need to quickly set up an Azure environment for demonstrations, or aim to reduce development environment maintenance effort as the platform team? Azd might be the ideal solution for you. We encourage you to give it a try today!
The new features are now in private preview. If interested, please register by scanning below QR Code or visiting https://aka.ms/azd-java-preview directly. We'll contact you within days. Your feedback will help us improve the public preview and GA releases.