Hello, Azure Spring Cloud

NOTE: This blog was drafted in cooperation with members of the Spring team and Microsoft Azure Spring Cloud team, including Josh Long, Julien Dubois, Sean Li, Kylie Liang, Jonathan Giles, Asir Selvasingh, and the rest of the Microsoft Azure Spring Cloud and VMware Spring teams.

Hi, Spring fans! It is with extreme delight that today we announce the general availability of Azure Spring Cloud. Azure Spring Cloud is a platform for deploying and managing Spring Boot and Spring Cloud-powered services and software built on Microsoft Azure. It is jointly built, operated, and supported by Microsoft and VMware.

The key concept of Azure Spring Cloud is to optimize the path to production for Spring Boot-based microservices on a platform that leverages the Azure Kubernetes service, abstracting away all the complexity involved in managing Kubernetes. Let’s look at how Azure Spring Cloud does this in concrete terms. You’ll need to first setup a new Azure Spring Cloud service instance. You can do that easily in the Azure Portal or on the command line. Once thats done we’re ready to ship software!

Let’s start with something simple. Go the Spring Initializr and build a new service. Add the Reactive Web dependency. Click Generate. You’ll be given a zip file which you should unzip. The resulting project you can open up in any IDE you want. Edit pom.xml and comment out the following dependencies for now:

Add the following Spring Webflux HTTP controller to your Java codebase in the same code page as your main application.

import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; import java.util.Collection; @RestController class HelloController { @GetMapping("/hello") Map<String, String> hello() { return java.util.Collections.singletonMap("greeting", "Hello from Azure Spring Cloud"); } }

And then build the application as you would any Spring Boot application from the root of the project using Apache Maven:

mvn clean package -f pom.xml 

This will give you a .jar that you can run normally: java -jar target/*jar.

The application works, and now you can configure an application instance on Azure Spring Cloud so that when you deploy the .jar, the platform will know what to do with it and how it should be configured.

You can create a new application in the Azure Portal or on the command line.

az spring-cloud app create -n simple-microservice

You only need to create an application definition once. Thereafter we’ll only need to deploy the application itself.

 az spring-cloud app deploy -n simple-microservice --jar-path target/demo-0.0.1-SNAPSHOT.jar

And with that, the application is running in the cloud! Congrats! You’re in production. It’s a nice feeling, isn’t it? Production, in this case, is a very robust environment.

Once in production, you’ll need distributed tracing and log aggregation.

You may want to centralize and secure configuration values, and this is trivial with the Spring Cloud Config Server, which is trivial to setup in Azure Spring Cloud.

And you can also take advantage of service registration and discovery using the pre-configured Eureka service registry in Azure Spring Cloud

The Spring on Azure Integrations

All that and we’ve only begun to tap the full power of Azure Spring Cloud! Azure Spring Cloud makes short work of standing up infrastructure to support microservices, but a typical application has a ton of other infrastructure requirements, and thankfully Microsoft Azure is more than ready to meet the need.

We still haven’t connected to a database, or a message queue, added security or anything else. Not to worry though, Spring Cloud for Microsoft Azure provides a rich toolbox allowing you to access Azure services in an idiomatic fashion for Spring applications. Let’s look at some, but definitively not all, of the possibilities.

  • You can use Spring Security to talk to Active Directory
  • You can use Spring Data R2DBC to talk to a Microsoft SQL Server instance in a reactive fashion, or use JDBC to talk to it in a non-reactive fashion
  • You can use the reactove Spring Data MongoDB module to talk to Azure CosmosDB
  • You can use Spring Cloud Stream to talk to Azure Service Bus

Josh looked at some of these opportunities in depth in this talk from June 2020, delivered to a joint assembly of the Singapore Java and Microsoft user groups.

A Pivotal Collaboration

In October 2019, Microsoft and VMware announced the collaboration of Azure Spring Cloud. Since then, many customers have approached us about this differentiated offering. Java and JVM developers in many organizations have used the service and provided us with plenty of feedback to prioritize features and shape Azure Spring Cloud. We have enabled security features to manage secrets, hybrid deployments, control ingress and egress to apps, and secure communications using TLS/SSL. To support performance and reliability we have enabled autoscaling, log streaming, alerts, and self-diagnostics.

Production is Awesome, and You Don’t Have to Take Our Word For It

We love the Azure Spring Cloud platform and we hope you will too. We know that lots of you already do!
As it turns out, production _is awesome, and you don’t have to take out word for it! There are a few customer quotes over on the official release blog.

Learn more at SpringOne 2020, today and tomorrow

  • Microsoft’s Asir Selvasingh and Adib Sakali are doing a customer panel later today at SpringOne 2020 on Wednesday, Sep 2 at 12:35 PM PDT
  • Microsoft’s Julien Dubois and Josh Long are presenting Bootiful Azure Spring Cloud at SpringOne 2020 on Thursday, Sep 3 at 11:35 AM PDT

Next Steps

comments powered by Disqus