Skip to content

Commit b699a7a

Browse files
committed
test zone-region adjustments to avoid duplication
1 parent ca3440a commit b699a7a

File tree

1 file changed

+11
-251
lines changed

1 file changed

+11
-251
lines changed

articles/spring-apps/quickstart.md

Lines changed: 11 additions & 251 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,19 @@ This quickstart explains how to:
3535
3636
At the end of this quickstart, you have a working Spring app running on Azure Spring Apps.
3737

38-
::: zone pivot="sc-consumption-plan"
38+
> [!NOTE]
39+
> To deploy a Spring Boot web app to Azure Spring Apps by using Visual Studio Code, follow the steps in [Java on Azure Spring Apps](https://code.visualstudio.com/docs/java/java-spring-apps).
3940
4041
## Prerequisites
4142

43+
::: zone pivot="sc-enterprise"
44+
45+
- If you're deploying Azure Spring Apps Enterprise tier for the first time in the target subscription, see the [Requirements](./how-to-enterprise-marketplace-offer.md#requirements) section of [View Azure Spring Apps Enterprise tier offering in Azure Marketplace](./how-to-enterprise-marketplace-offer.md).
46+
47+
::: zone-end
48+
49+
::: zone pivot="sc-consumption-plan"
50+
4251
- An Azure subscription. If you don't have a subscription, create a [free account](https://azure.microsoft.com/free/) before you begin.
4352
- [Apache Maven](https://maven.apache.org/download.cgi)
4453
- [Azure CLI](/cli/azure/install-azure-cli). Install the Azure CLI extension for Azure Spring Apps Standard consumption plan by using the following command.
@@ -195,12 +204,10 @@ Deploying the application can take a few minutes.
195204

196205
::: zone-end
197206

198-
::: zone pivot="sc-standard"
207+
::: zone pivot="sc-standard,sc-enterprise"
199208

200209
## [Azure CLI](#tab/Azure-CLI)
201210

202-
## Prerequisites
203-
204211
- An Azure subscription. If you don't have a subscription, create a [free account](https://azure.microsoft.com/free/) before you begin.
205212
- [Apache Maven](https://maven.apache.org/download.cgi)
206213
- [Azure CLI](/cli/azure/install-azure-cli). Install the Azure Spring Apps extension with the following command: `az extension add --name spring`
@@ -303,8 +310,6 @@ Deploying the application can take a few minutes.
303310

304311
## [IntelliJ](#tab/IntelliJ)
305312

306-
## Prerequisites
307-
308313
- An Azure subscription. If you don't have a subscription, create a [free account](https://azure.microsoft.com/free/) before you begin.
309314
- [IntelliJ IDEA](https://www.jetbrains.com/idea/).
310315
- [Azure Toolkit for IntelliJ](/azure/developer/java/toolkit-for-intellij/install-toolkit).
@@ -418,251 +423,6 @@ Use the following steps to build and deploy your app.
418423

419424
1. To start the deployment, select the **Run** button at the bottom of the **Deploy Azure Spring Apps app** dialog box. The plug-in runs the command `mvn package -DskipTests` on the `hellospring` app and deploys the *.jar* file generated by the `package` command.
420425

421-
## [Visual Studio Code](#tab/VS-Code)
422-
423-
## Deploy a Spring Boot web app to Azure Spring Apps with Visual Studio Code
424-
425-
To deploy a Spring Boot web app to Azure Spring Apps, follow the steps in [Java on Azure Spring Apps](https://code.visualstudio.com/docs/java/java-spring-apps).
426-
427-
---
428-
429-
::: zone-end
430-
431-
::: zone pivot="sc-enterprise"
432-
433-
## [Azure CLI](#tab/Azure-CLI)
434-
435-
## Prerequisites
436-
437-
- An Azure subscription. If you don't have a subscription, create a [free account](https://azure.microsoft.com/free/) before you begin.
438-
- [Apache Maven](https://maven.apache.org/download.cgi)
439-
- [Azure CLI](/cli/azure/install-azure-cli). Install the Azure Spring Apps extension with the following command: `az extension add --name spring`
440-
- If you're deploying Azure Spring Apps Enterprise tier for the first time in the target subscription, see the [Requirements](./how-to-enterprise-marketplace-offer.md#requirements) section of [View Azure Spring Apps Enterprise tier offering in Azure Marketplace](./how-to-enterprise-marketplace-offer.md).
441-
442-
## Provision an instance of Azure Spring Apps
443-
444-
Use the following steps to create an Azure Spring Apps service instance.
445-
446-
1. Select **Open Cloudshell** and sign in to your Azure account in [Azure Cloud Shell](../cloud-shell/overview.md).
447-
448-
```azurecli-interactive
449-
az account show
450-
```
451-
452-
1. Azure Cloud Shell workspaces are temporary. When first started, the shell prompts you to associate an [Azure Storage](../storage/common/storage-introduction.md) instance with your subscription to persist files across sessions.
453-
454-
:::image type="content" source="media/quickstart/azure-storage-subscription.png" alt-text="Screenshot of Azure Storage subscription." lightbox="media/quickstart/azure-storage-subscription.png":::
455-
456-
1. After you sign in successfully, use the following command to display a list of your subscriptions.
457-
458-
```azurecli-interactive
459-
az account list --output table
460-
```
461-
462-
1. Use the following command to set your default subscription.
463-
464-
```azurecli-interactive
465-
az account set --subscription <subscription-ID>
466-
```
467-
468-
1. Use the following command to create a resource group.
469-
470-
```azurecli-interactive
471-
az group create \
472-
--resource-group <name-of-resource-group> \
473-
--location eastus
474-
```
475-
476-
1. Use the following command to create an Azure Spring Apps service instance.
477-
478-
```azurecli-interactive
479-
az spring create \
480-
--resource-group <name-of-resource-group> \
481-
--name <Azure-Spring-Apps-instance-name>
482-
```
483-
484-
1. Select **Y** to install the Azure Spring Apps extension and run it.
485-
486-
## Create an app in your Azure Spring Apps instance
487-
488-
An [*App*](concept-understand-app-and-deployment.md) is an abstraction of one business app. Apps run in an Azure Spring Apps service instance, as shown in the following diagram.
489-
490-
:::image type="content" source="media/spring-cloud-app-and-deployment/app-deployment-rev.png" alt-text="Diagram showing the relationship between apps and an Azure Spring Apps service instance.":::
491-
492-
Use the following command to specify the app name on Azure Spring Apps as *hellospring*.
493-
494-
```azurecli-interactive
495-
az spring app create \
496-
--resource-group <name-of-resource-group> \
497-
--service <Azure-Spring-Apps-instance-name> \
498-
--name hellospring \
499-
--assign-endpoint true
500-
```
501-
502-
## Clone and build the Spring Boot sample project
503-
504-
Use the following steps to clone the Spring Boot sample project.
505-
506-
1. Use the following command to clone the [Spring Boot sample project](https://github.com/spring-guides/gs-spring-boot.git) from GitHub.
507-
508-
```azurecli-interactive
509-
git clone -b boot-2.7 https://github.com/spring-guides/gs-spring-boot.git
510-
```
511-
512-
1. Use the following command to move to the project folder.
513-
514-
```azurecli-interactive
515-
cd gs-spring-boot/complete
516-
```
517-
518-
1. Use the following [Maven](https://maven.apache.org/what-is-maven.html) command to build the project.
519-
520-
```azurecli-interactive
521-
mvn clean package -DskipTests
522-
```
523-
524-
## Deploy the local app to Azure Spring Apps
525-
526-
Use the following command to deploy the *.jar* file for the app (*target/spring-boot-complete-0.0.1-SNAPSHOT.jar* on Windows).
527-
528-
```azurecli-interactive
529-
az spring app deploy \
530-
--resource-group <name-of-resource-group> \
531-
--service <Azure-Spring-Apps-instance-name> \
532-
--name hellospring \
533-
--artifact-path target/spring-boot-complete-0.0.1-SNAPSHOT.jar
534-
```
535-
536-
Deploying the application can take a few minutes.
537-
538-
## [IntelliJ](#tab/IntelliJ)
539-
540-
## Prerequisites
541-
542-
- An Azure subscription. If you don't have a subscription, create a [free account](https://azure.microsoft.com/free/) before you begin.
543-
- [IntelliJ IDEA](https://www.jetbrains.com/idea/).
544-
- [Azure Toolkit for IntelliJ](/azure/developer/java/toolkit-for-intellij/install-toolkit).
545-
- If you're deploying Azure Spring Apps Enterprise tier for the first time in the target subscription, see the [Requirements](./how-to-enterprise-marketplace-offer.md#requirements) section of [View Azure Spring Apps Enterprise tier offering in Azure Marketplace](./how-to-enterprise-marketplace-offer.md).
546-
547-
## Generate a Spring project
548-
549-
Use the following steps to create the project:
550-
551-
1. Use [Spring Initializr](https://start.spring.io/#!type=maven-project&language=java&platformVersion=2.6.10&packaging=jar&jvmVersion=11&groupId=com.example&artifactId=hellospring&name=hellospring&description=Demo%20project%20for%20Spring%20Boot&packageName=com.example.hellospring&dependencies=web,cloud-eureka,actuator,cloud-config-client) to generate a sample project with recommended dependencies for Azure Spring Apps. The following URL provides default settings for you.
552-
553-
```url
554-
https://start.spring.io/#!type=maven-project&language=java&platformVersion=2.6.10&packaging=jar&jvmVersion=11&groupId=com.example&artifactId=hellospring&name=hellospring&description=Demo%20project%20for%20Spring%20Boot&packageName=com.example.hellospring&dependencies=web,cloud-eureka,actuator,cloud-config-client
555-
```
556-
557-
The following image shows the recommended Initializr settings for the *hellospring* sample project.
558-
559-
This example uses Java version 11. To use a different Java version, change the Java version setting under **Project Metadata**.
560-
561-
:::image type="content" source="media/quickstart/initializr-page.png" alt-text="Screenshot of Spring Initializr page." lightbox="media/quickstart/initializr-page.png":::
562-
563-
1. When all dependencies are set, select **Generate**.
564-
1. Download and unpack the package, and then create a web controller for your web application by adding the file *src/main/java/com/example/hellospring/HelloController.java* with the following contents:
565-
566-
```java
567-
package com.example.hellospring;
568-
569-
import org.springframework.web.bind.annotation.RestController;
570-
import org.springframework.web.bind.annotation.RequestMapping;
571-
572-
@RestController
573-
public class HelloController {
574-
575-
@RequestMapping("/")
576-
public String index() {
577-
return "Greetings from Azure Spring Apps!";
578-
}
579-
}
580-
```
581-
582-
## Create an instance of Azure Spring Apps
583-
584-
Use the following steps to create an instance of Azure Spring Apps using the Azure portal.
585-
586-
1. In a new tab, open the [Azure portal](https://portal.azure.com/).
587-
588-
1. From the top search box, search for **Azure Spring Apps**.
589-
590-
1. Select **Azure Spring Apps** from the results.
591-
592-
:::image type="content" source="media/quickstart/spring-apps-start.png" alt-text="Screenshot of Azure portal showing Azure Spring Apps service in search results." lightbox="media/quickstart/spring-apps-start.png":::
593-
594-
1. On the Azure Spring Apps page, select **Create**.
595-
596-
:::image type="content" source="media/quickstart/spring-apps-create.png" alt-text="Screenshot of Azure portal showing Azure Spring Apps resource with Create button highlighted." lightbox="media/quickstart/spring-apps-create.png":::
597-
598-
1. Fill out the form on the Azure Spring Apps **Create** page. Consider the following guidelines:
599-
600-
- **Subscription**: Select the subscription you want to be billed for this resource.
601-
- **Resource group**: Creating new resource groups for new resources is a best practice.
602-
- **Service Name**: Specify the service instance name. You use this name later in this article where the *\<Azure-Spring-Apps-instance-name\>* placeholder appears. 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.
603-
- **Region**: Select the region for your service instance.
604-
605-
:::image type="content" source="media/quickstart/portal-start.png" alt-text="Screenshot of Azure portal showing Azure Spring Apps Create page." lightbox="media/quickstart/portal-start.png":::
606-
607-
1. Select **Review and create**.
608-
609-
## Import the project
610-
611-
Use the following steps to import the project.
612-
613-
1. Open IntelliJ IDEA, and then select **Open**.
614-
1. In the **Open File or Project** dialog box, select the *hellospring* folder.
615-
616-
:::image type="content" source="media/quickstart/intellij-new-project.png" alt-text="Screenshot of IntelliJ IDEA showing Open File or Project dialog box." lightbox="media/quickstart/intellij-new-project.png":::
617-
618-
## Build and deploy your app
619-
620-
> [!NOTE]
621-
> To run the project locally, add `spring.config.import=optional:configserver:` to the project's *application.properties* file.
622-
623-
Use the following steps to build and deploy your app.
624-
625-
1. If you haven't already installed the Azure Toolkit for IntelliJ, follow the steps in [Install the Azure Toolkit for IntelliJ](/azure/developer/java/toolkit-for-intellij/install-toolkit).
626-
627-
1. Right-click your project in the IntelliJ Project window, and then select **Azure** -> **Deploy to Azure Spring Apps**.
628-
629-
:::image type="content" source="media/quickstart/intellij-deploy-azure.png" alt-text="Screenshot of IntelliJ IDEA menu showing Deploy to Azure Spring Apps option." lightbox="media/quickstart/intellij-deploy-azure.png":::
630-
631-
1. Accept the name for the app in the **Name** field. **Name** refers to the configuration, not the app name. You don't usually need to change it.
632-
1. In the **Artifact** textbox, select **Maven:com.example:hellospring-0.0.1-SNAPSHOT**.
633-
1. In the **Subscription** textbox, verify that your subscription is correct.
634-
1. In the **Service** textbox, select the instance of Azure Spring Apps that you created in [Provision an instance of Azure Spring Apps](#provision-an-instance-of-azure-spring-apps-1).
635-
1. In the **App** textbox, select the plus sign (**+**) to create a new app.
636-
637-
:::image type="content" source="media/quickstart/intellij-create-new-app.png" alt-text="Screenshot of IntelliJ IDEA showing Deploy Azure Spring Apps dialog box." lightbox="media/quickstart/intellij-create-new-app.png":::
638-
639-
1. In the **App name:** textbox under **App Basics**, enter *hellospring*, and then select the **More settings** check box.
640-
1. Select the **Enable** button next to **Public endpoint**. The button changes to **Disable \<to be enabled\>**.
641-
1. If you're using Java 11, select **Java 11** for the **Runtime** option.
642-
1. Select **OK**.
643-
644-
:::image type="content" source="media/quickstart/intellij-more-settings.png" alt-text="Screenshot of IntelliJ IDEA Create Azure Spring Apps dialog box with public endpoint Disable button highlighted." lightbox="media/quickstart/intellij-more-settings.png":::
645-
646-
1. Under **Before launch**, select **Run Maven Goal 'hellospring:package'**, and then select the pencil icon to edit the command line.
647-
648-
:::image type="content" source="media/quickstart/intellij-edit-maven-goal.png" alt-text="Screenshot of IntelliJ IDEA Create Azure Spring Apps dialog box with Maven Goal edit button highlighted." lightbox="media/quickstart/intellij-edit-maven-goal.png":::
649-
650-
1. In the **Command line** textbox, enter *-DskipTests* after *package*, and then select **OK**.
651-
652-
:::image type="content" source="media/quickstart/intellij-maven-goal-command-line.png" alt-text="Screenshot of IntelliJ IDEA Select Maven Goal dialog box with Command Line value highlighted." lightbox="media/quickstart/intellij-maven-goal-command-line.png":::
653-
654-
1. To start the deployment, select the **Run** button at the bottom of the **Deploy Azure Spring Apps app** dialog box. The plug-in runs the command `mvn package -DskipTests` on the `hellospring` app and deploys the *.jar* file generated by the `package` command.
655-
656-
## [Visual Studio Code](#tab/VS-Code)
657-
658-
## Prerequisites
659-
660-
- If you're deploying Azure Spring Apps Enterprise tier for the first time in the target subscription, see the [Requirements](./how-to-enterprise-marketplace-offer.md#requirements) section of [View Azure Spring Apps Enterprise tier offering in Azure Marketplace](./how-to-enterprise-marketplace-offer.md).
661-
662-
## Deploy a Spring Boot web app to Azure Spring Apps with Visual Studio Code
663-
664-
To deploy a Spring Boot web app to Azure Spring Apps, follow the steps in [Java on Azure Spring Apps](https://code.visualstudio.com/docs/java/java-spring-apps).
665-
666426
---
667427

668428
::: zone-end

0 commit comments

Comments
 (0)