Quickstart: Launch an Azure Spring Cloud application using the Azure portal
Azure Spring Cloud enables you to easily run Spring Cloud based microservice applications on Azure.
This quickstart shows you how to deploy an existing Spring Cloud application to Azure. You can find the sample application code used in this tutorial in our GitHub samples repository. When you're finished, the provided sample application will be accessible online and ready to be managed via the Azure portal.
Following this quickstart, you will learn how to:
- Provision a service instance
- Set a configuration server for an instance
- Build a microservices application locally
- Deploy each microservice
- Assign public endpoint for your application
Prerequisites
Note
Azure Spring Cloud is currently offered as a public preview. Public preview offerings allow customers to experiment with new features prior to their official release. Public preview features and services are not meant for production use. For more information about support during previews, please review our FAQ or file a Support request to learn more.
Tip
The Azure Cloud Shell is a free interactive shell that you can use to run the steps in this article. It has common Azure tools preinstalled, including the latest versions of Git, JDK, Maven, and the Azure CLI. If you are logged in to your Azure subscription, launch your Azure Cloud Shell from shell.azure.com. You can learn more about Azure Cloud Shell by reading our documentation
To complete this quickstart:
- Install Git
- Install JDK 8
- Install Maven 3.0 or above
- Install the Azure CLI version 2.0.67 or higher
- Sign up for an Azure subscription
Install the Azure CLI extension
Install the Azure Spring Cloud extension for the Azure CLI using the following command
az extension add --name spring-cloud
Provision a service instance on the Azure portal
In a web browser, open this link to Azure Spring Cloud in the Azure portal.
Fill out the form on the Azure Spring Cloud Create page. Consider the following guidelines:
- Service Name: Specify the name of your service instance. The name must be between 4 and 32 characters long and can contain only lowercase letters, numbers, and hyphens. The first character of the service name must be a letter and the last character must be either a letter or a number.
- Subscription: Select the subscription you want to be billed for this resource. Ensure that this subscription has been added to our allow-list for Azure Spring Cloud.
- Resource group: Creating new resource groups for new resources is a best practice.
- Location: Select the location for your service instance. Currently supported locations include East US, West US 2, West Europe, and Southeast Asia.
Click Review and create.
Verify your specifications, and click Create.
It takes about 5 minutes for the service to deploy. Once it is deployed, the Overview page for the service instance will appear.
Set up your configuration server
Go to the service Overview page and select Config Server.
In the Default repository section, set URI to "https://github.com/Azure-Samples/piggymetrics".
Set LABEL to "config".
Select Apply to save your changes.

Build and deploy microservice applications
Open an Azure Cloud Shell and clone the sample app repository to your local machine. Here, we first create a temporary directory called
source-codebefore cloning the app.mkdir source-code cd source-code git clone https://github.com/Azure-Samples/piggymetricsBuild the cloned package.
cd piggymetrics mvn clean package -DskipTestsAssign names to your resource group and your service. Be sure to substitute the placeholders below with the resource group name and service name that you provisioned earlier in this tutorial.
az configure --defaults group=<resource group name> az configure --defaults spring-cloud=<service instance name>Create the
gatewayapplication and deploy the JAR file.az spring-cloud app create -n gateway az spring-cloud app deploy -n gateway --jar-path ./gateway/target/gateway.jarFollowing the same pattern, create the
account-serviceandauth-serviceapplications and deploy their JAR files.az spring-cloud app create -n account-service az spring-cloud app deploy -n account-service --jar-path ./account-service/target/account-service.jar az spring-cloud app create -n auth-service az spring-cloud app deploy -n auth-service --jar-path ./auth-service/target/auth-service.jarIt takes a few minutes to finish deploying the applications. To confirm that they have deployed, go to the Apps blade in the Azure portal. You should see a line each of the three applications.
Assign a public endpoint to gateway
Open the Apps tab in the menu on the left.
Select the
gatewayapplication to show the Overview page.Select Assign Domain to assign a public endpoint to gateway. This can take a few minutes.

Enter the assigned public endpoint (labeled URL) into your browser to view your running application.

Next steps
In this quickstart, you learned how to:
- Provision a service instance
- Set a configuration server for an instance
- Build a microservices application locally
- Deploy each microservice
- Assign public endpoint for your application gateway
More samples are available on GitHub: Azure Spring Cloud Samples.
Feedback
Loading feedback...




