Microsoft affirms its commitment to the Java ecosystem by offering open-source distribution of Java with the Microsoft Build of OpenJDK™. It’s a no-cost, Long-Term Support (LTS) distribution of OpenJDK currently available for preview.

The preview build includes the binaries for Java 11 available on x64 server and desktop environments on Windows, macOS, and Linux. An early-access release for Java 16 is available for Windows on ARM. Microsoft is currently collecting feedback on the packing and installer of the build on various platforms from the users of the preview build and aims to release the GA build by the end of 2021.

Why Microsoft is Offering JDK Distribution?

Microsoft has been deeply involved in the Java ecosystem by offering Java tools for Visual Studio Code, supporting Java on Azure, running several internal platforms, and some Azure infrastructure services on Java Virtual Machine (JVM). Microsoft runs more than 500,000 JVMs internally, excluding all Azure services and customer workloads. Azure has experienced significant growth in Java workloads through Azure Spring Cloud, Azure App Service, Azure Functions, and Azure Kubernetes Service. LinkedIn, Minecraft, and Yammer are examples of major internal platforms run on Java.

Below are few critical triggers outside the rise of internal JVM workloads for Microsoft to jump into OpenJDK distribution:

  • Cost reduction: Java support costs on Azure cloud can be reduced by avoiding commercial licenses for Java. It helps to reduce the overall Azure subscription costs by removing the cost passed to other vendors for JDK licenses.
  • Security & performance improvement: The build may contain backported fixes and enhancements for security and performance, which may not have formally backported upstream.
  • Support Java devs: Part of Microsoft’s dedication to better support Java developers on Azure.
  • Become a leader in providing toolkits for the open-source community: Microsoft has been a sponsor and contributor to the Java open-source community through AdoptOpenJDK projects since 2018, and has contributed to OpenJDK by providing more than 50 patches for OpenJDK in the last 18 months, which includes resolutions for issues in macOS packaging, build, infrastructure, and garbage collection.

Benefits to Java Developers on Azure

  • Multi-OS Support: Windows, macOS, and Linux
  • Multi-Environment Support: cloud, local data centers, and user development environments
  • Free to Use: the Microsoft Build of OpenJDK is at no cost to use.
  • Backed by Microsoft: This is backed by the promise of Microsoft. Many backported fixes and enhancements are recommended by Microsoft that may not be available in upstream OpenJDK implementations.
  • Ease of Migration: Smooth and transparent transition for existing workloads.

Limitations

  • Docker image is not available at this point
  • Medium-term support releases of OpenJDK are not supported
  • No API available to access the binary distribution
  • No ARM-based macOS binary at this point

How to Install on Windows

The packages and installer for Microsoft’s OpenJDK preview build are available at https://www.microsoft.com/openjdk#11. Azure customers can try out the preview using Azure Cloud Shell too.

Download the package on the platform of your choice and confirm the Java version. For Windows, the installer takes care of the default location and setting PATH and JAVA_HOME environment variables.

Microsoft Build of OpenJDK on Windows 10

Picture 1: Microsoft Build of OpenJDK on Windows 10
A build of Open JDK 11 is already available in the Azure Cloud Shell; developers can use it with Shell.

Microsoft Build of OpenJDK on Azure Cloud Shell

Picture 2: Microsoft Build of OpenJDK on Azure Cloud Shell

We expect more enterprise organizations modernizing Java on Azure with increased support and options from Microsoft. This is welcome news to organizations with a large investment in Java and has experienced a large increase in the cost of legacy Java workloads. Need a partner to accelerate your modernization journey? Reach out to AIS today.

Reference

Azure Spring Cloud logoSpring Framework is one of the most popular frameworks for application development using Java. Spring Boot is one of the top modules of Spring Framework, which is widely used to build enterprise-grade highly scalable backend applications. Spring Boot is very popular to develop microservices using open-source technologies, and its Pivotal Team develops it.

Microsoft and Pivotal/VMware build and operate Azure Spring Cloud, a native Azure service offered as Platform as a Service (PaaS) and available on Azure Marketplace.

Why Use Azure Spring Cloud?

There are many benefits in deploying an application to Azure Spring Cloud

  • Spring Boot framework helps to reduce the overall application development time.
  • Azure Spring Cloud further accelerates and simplifies infrastructure management needed for hosting Spring Boot applications.
  • It’s easy to deploy existing Spring Boot applications without code changes.
  • For new development, the managed environment provides infrastructure services such as Eureka, Config Server, Service Registry Server, and blue-green deployment. There is no need to create, deploy or manage services that can provide these functionalities.
  • Develop and deploy rapidly without containerization dependencies.
  • It is easy to bind applications with other Azure services such as Azure Cosmos DB, Azure Database for MySQL, and Azure Cache for Redis.
  • Monitor production workload efficiently and effortlessly.
  • Provides security features to manage secrets.
  • Supports hybrid deployment.
  • Easily control ingress and egress to the app.
  • Scalable global infrastructure
  • Automatically wire apps with Spring Cloud infrastructure

Azure Service Overview

Azure Spring Cloud offers first-class support for Spring tools, and it quickly binds to other Azure services, including storage, database, monitoring, etc.

Azure Service Overview
Picture 1 – Azure Spring Cloud-Service Overview

Reference – https://docs.microsoft.com/en-us/azure/spring-cloud/media/spring-cloud-principles/azure-spring-cloud-overview.png

Service Tiers and Limits
Azure Spring Cloud offers Basic and Standard tiers and set default limits and quotas. Some default limits can be increased vis a support ticket.

Tiers for Azure Spring Cloud
Table 1 – Quotas and limits

Java, Spring Boot, and Spring Cloud Versions

  • Azure Spring Cloud hosting environment contains the latest Azul Zulu OpenJDK version for Azure, and it supports Java 8 and Java 11.
  • The minimum Spring Boot version needed for Azure Spring Cloud is either Spring Boot version 2.1 or version 2.2

The following table lists the supported Spring Boot and Spring Cloud combinations:

Spring Boot vs. Spring Cloud
Table 2 – Java and Spring supported versions

Azure Spring Cloud Setup

In this review, the application to get weather details of cities is decomposed into three microservices to explain the capabilities of Azure Spring Cloud. It includes a gateway service and two microservices for city and weather details, respectively. Microservices talk to each other to retrieve weather details of cities. Various Azure infrastructure services used in the sample app are mentioned in respective sections of this document. Below are the details of microservices:

  • A gateway microservice based on Spring Cloud Gateway: gateway application
  • A reactive microservice that stores its data on Cosmos DB: city-service application
  • A microservice that stores its data on MySQL: weather-service application
Azure Spring Cloud Instance with Microservices
Picture 2 – Azure Spring Cloud Instance with microservices deployed on Azure Portal

Deploying Spring Boot applications into Azure Spring Cloud includes the general steps below:

  • Create an Azure Spring Cloud instance through Azure Portal or using CLI, if not already created.
  • Add the Azure Spring Cloud extension by running the following command: az extension add -n spring-cloud -y
  • Build Spring Boot application locally; mvn clean package
  • Create a new Azure Spring Cloud app within your Azure Spring Cloud instance: az spring-cloud app create -n {my-app}
  • Deploy the app to Azure Spring Cloud: az spring-cloud app deploy -n {my-app} –jar-path target/my-app.jar

Deploy a sample application to Azure Spring Cloud

Below are high-level steps to create and deploy a sample application on Azure Spring Cloud using Azure portal:

  • Look for your Azure Spring Cloud instance in your resource group
  • Click on the “Apps” link under “Settings” on the navigation sidebar.
  • Click on the “Create App” link at the top of the Apps page.
  • Create a new application named “simple-microservice.”
Sample application deployed view
Picture 3 – Sample application deployed view on Azure Portal
Sample application
Picture 4 – Sample application access response on browser

Key offerings from Azure Spring Cloud

Spring Cloud Config Server

Multiple microservices can use the same Spring Cloud Service Config Server, which is pre-configured and managed. It uses a pluggable repository that currently supports local storage, Git, and Subversion. Spring Cloud Config is used here to inject settings from a Git repository into the application and display it on the screen.

Below are steps to enable Azure Spring Cloud to create a configuration server with the configuration files from a public git repository – https://github.com/Azure-Samples/spring-cloud-sample-public-config.git

Note: A public git repository is used for example purposes only.

  • Go to the Azure portal.
  • Go to the overview page of your Azure Spring Cloud server and select “Config server” in the menu
  • Set the repository URL: https://github.com/Azure-Samples/spring-cloud-sample-public-config.git
  • Click on “Validate” and wait for the operation to succeed
  • Click on “Apply” and wait for the operation to succeed
Azure Spring Cloud Config Server
Picture 5 – Settings to configure Config Server

Log Streaming and Analytics

Log Analytics is part of Azure Monitor, and it’s integrated into Azure Spring Cloud. Azure Spring Cloud offers logs/metrics collection and storage relying on Log Analytics, Azure Storage, or Azure Event Hubs.

The following are steps to configure the Azure Spring Cloud instance to send its logs to the Log Analytics workspace:

  • Create Log Analytics workspace named sclab-la-hqd2ksd3p6z3g

Configure the log analytics workspace for the Azure Spring Cloud instance:

Azure spring cloud lab arunm
Picture 6 – Settings to configure log data collection

The workspace allows running queries on the aggregated logs. Below is a screenshot of querying logs using Azure Portal.

Log Access view on Azure Portal
Picture 7 – Log access view on Azure Portal

Distributed Tracing

Azure Spring Cloud provides the capability to view Application Map, which completely relies on Azure Application Insights. It provides a detailed view of how components interact with each other and the ability to trace requests. This helps to quickly visualize how applications are performing, as well as detect and diagnose issues across microservices.

Application Map on Azure Application Insights
Picture 8 – Example of an Application Map on Azure Application Insights

Performance Metrics

Azure Spring Cloud provides out-of-the-box capabilities to review application performance metrics.

Performance dashboard on Azure Portal
Picture 9 – Example of a Performance dashboard on Azure Portal

Application Scaling

The application can be scaled out quickly based on insights from distributed tracing. Both manual scaling and auto-scaling options are available. An application can easily be configured to scale up Azure Spring Cloud app resources as needed through the Azure Portal or via equivalent Azure CLI commands.

Microsoft Azure Portal application scaling
Picture 10 – Application scaling setting example
Autoscale Settings in Azure Portal
Picture 11 – Application autoscaling settings screen

Blue-Green Deployment

The blue-green deployment pattern allows testing the latest application changes on production infrastructure without exposing the changes to consumers until your testing is complete. Refer to this documentation to set up a staging environment in Azure Spring Cloud.

Conclusion

Azure Spring Cloud is an excellent service to quickly build, deploy and maintain Spring Boot applications securely in the cloud with minimal efforts and a rich set of application monitoring and alerting features.

In summary, Azure Spring Cloud provides the below benefits:

  • Easy and simple development approaches
  • Less infrastructure to manage
  • High availability with b/g deployment
  • A secure network
  • Elastic and scalable infrastructure
  • Highly automated environment

Known Limitations

  • Azure portal and ARM templates do not support uploading application packages.
  • Server.port default to port 1025; other values will be overridden.
  • Spring.application.name will be overridden by the application name that’s used to create each application.
  • The latest version of Java is not supported. Azure Spring Cloud supports Java 8 and 11.
  • Spring Boot 2.4.x application has a known TLS authentication issue with Eureka.
  • Service binding currently supports only limited services; Cosmos DB, Azure DB for MySQL, and Azure Cache for Redis are currently supported.

References