Deploying Spring Boot on Azure (Spring Apps)

Azure Spring Apps (formerly Spring Cloud Azure) is a fully managed service by Microsoft and VMware to run Spring Boot applications natively on Azure. It abstracts away the infrastructure so you can focus on code, while gaining access to enterprise-grade scaling, monitoring, and CI/CD integration.

In this detailed guide, you’ll learn how to:

  • Deploy a Spring Boot app to Azure Spring Apps
  • Set up the environment using Azure CLI
  • Configure settings, monitoring, and scaling
  • Secure and automate deployment via CI/CD

Weโ€™ll use the base package:
com.kscodes.springboot.containers

Deploying Spring Boot on Azure (Spring Apps)

๐Ÿงฐ Prerequisites

Ensure you have:

  • Azure account with subscription
  • Azure CLI installed and logged in (az login)
  • Spring Boot app (with Maven)
  • Java 17+ or 21
  • Maven or Gradle project
  • Optional: GitHub Actions for CI/CD

๐Ÿš€ Step 1: Create Spring Boot App

Sample REST controller:

Build the JAR:

โš™๏ธ Step 2: Create Azure Resources

Login and set default values:

Create a resource group:

Create the Azure Spring Apps service:

๐Ÿ“ฆ Step 3: Create the App in Azure Spring Apps

๐Ÿš€ Step 4: Deploy Spring Boot App

๐ŸŒ Step 5: Access the App

Get the default endpoint:

Paste the URL in your browser โ€” youโ€™ll see your Spring Boot app live on Azure.

๐Ÿ”’ Step 6: Environment Variables & Secrets

Set environment variables:

Azure Spring Apps injects these automatically at runtime.

๐Ÿ“ˆ Step 7: Enable Monitoring (Azure Monitor + App Insights)

Enable distributed tracing with Azure Monitor:

Youโ€™ll get access to logs, metrics, and tracing in Azure Monitor and Application Insights.

๐Ÿ” Optional: GitHub Actions for CI/CD

Azure automatically suggests a GitHub Actions workflow. You can also create a basic one:

๐Ÿ”„ Scaling the App

โœ… Benefits of Azure Spring Apps

FeatureDescription
No infra managementFully managed Spring Boot runtime
Built-in scalingInstance auto-scaling and manual control
Azure AD integrationSecure identity and access control
ObservabilityApplication Insights + Log Analytics
CI/CD readyGitHub Actions and Azure DevOps integration

๐Ÿง  Summary

You just learned how to deploy a Spring Boot app to Azure Spring Apps, Microsoftโ€™s fully managed platform for Spring workloads. You created a service, deployed your app, exposed it publicly, and added configuration and monitoring โ€” all using Azure CLI.

This approach is ideal for enterprises and developers looking to run Spring Boot apps in the cloud without managing VMs or Kubernetes.