Quickstart: Deploy microservice applications to Azure Spring Apps

Note

The Basic, Standard, and Enterprise plans will be deprecated starting from mid-March, 2025, with a 3 year retirement period. We recommend transitioning to Azure Container Apps. For more information, see the Azure Spring Apps retirement announcement.

The Standard consumption and dedicated plan will be deprecated starting September 30, 2024, with a complete shutdown after six months. We recommend transitioning to Azure Container Apps.

This article explains how to deploy microservice applications to Azure Spring Apps using the well-known sample app PetClinic.

The Pet Clinic sample demonstrates the microservice architecture pattern. The following diagram shows the architecture of the PetClinic application on the Azure Spring Apps Standard plan.

Diagram that shows the architecture of the PetClinic sample on the Azure Spring Apps standard plan.

The diagram shows the following architectural flows and relationships of the Pet Clinic sample:

  • Uses Azure Spring Apps to manage the Spring Boot apps. Each app uses HSQLDB as the persistent store.
  • Uses the managed components Spring Cloud Config Server and Eureka Service Registry on Azure Spring Apps. The Config Server reads the Git repository configuration.
  • Exposes the URL of API Gateway to load balance requests to service apps, and exposes the URL of the Admin Server to manage the applications.
  • Analyzes logs using the Log Analytics workspace.
  • Monitors performance with Application Insights.

Note

This article uses a simplified version of PetClinic, using an in-memory database that isn't production-ready to quickly deploy to Azure Spring Apps.

The deployed app admin-server exposes public access, which is a risk point. The production environment needs to secure the Spring Boot Admin application.

This article provides the following options for deploying to Azure Spring Apps:

  • The Azure portal + Maven plugin option is a more conventional way to create resources and deploy applications step by step. This option is suitable for Spring developers using Azure cloud services for the first time.
  • The Azure Developer CLI option is a more efficient way to automatically create resources and deploy applications through simple commands. The Azure Developer CLI uses a template to provision the Azure resources needed and to deploy the application code. This option is suitable for Spring developers who are familiar with Azure cloud services.

1. Prerequisites