Update unit 2 to the latest ASC version

This commit is contained in:
Julien Dubois 2021-12-07 16:18:10 +01:00
Родитель 5cb546dd83
Коммит 848f278bd2
7 изменённых файлов: 11 добавлений и 11 удалений

Просмотреть файл

@ -29,7 +29,7 @@ This training lab requires the following to be installed on your machine:
* The Bash shell. While Azure CLI should behave identically on all environments, shell semantics vary. Therefore, only bash can be used with the commands in this training. To complete this training on Windows, use [Git Bash that accompanies the Windows distribution of Git](https://git-scm.com/download/win). **Use only Git Bash to complete this training on Windows. Do not use WSL, CloudShell, or any other shell.** * The Bash shell. While Azure CLI should behave identically on all environments, shell semantics vary. Therefore, only bash can be used with the commands in this training. To complete this training on Windows, use [Git Bash that accompanies the Windows distribution of Git](https://git-scm.com/download/win). **Use only Git Bash to complete this training on Windows. Do not use WSL, CloudShell, or any other shell.**
* [Azure CLI](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest&WT.mc_id=azurespringcloud-github-judubois) version 2.30.0 or later. You can check the version of your current Azure CLI installation by running: * [Azure CLI](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest&WT.mc_id=azurespringcloud-github-judubois) version 2.31.0 or later. You can check the version of your current Azure CLI installation by running:
```bash ```bash
az --version az --version

Просмотреть файл

@ -77,16 +77,16 @@ In order to create the app instance graphically, you can use [the Azure portal](
- Look for your Azure Spring Cloud instance in your resource group - Look for your Azure Spring Cloud instance in your resource group
- Click on the "Apps" link under "Settings" on the navigation sidebar. - Click on the "Apps" link under "Settings" on the navigation sidebar.
- Click on "Create App" link at the top of the Apps page. - Click on "Create App" link at the top of the Apps page.
- Create a new application named "simple-microservice" - Create a new application named "simple-microservice", using the Java 11 environment.
![Create application](media/01-create-application.png) ![Create application](media/00-create-application.png)
- Click on "Create". - Click on "Create".
Alternatively, you can use the command line to create the app instance, which is easier: Alternatively, you can use the command line to create the app instance, which is easier:
```bash ```bash
az spring-cloud app create -n simple-microservice az spring-cloud app create -n simple-microservice --runtime-version Java_11
``` ```
You can now build your "simple-microservice" project and deploy it to Azure Spring Cloud: You can now build your "simple-microservice" project and deploy it to Azure Spring Cloud:
@ -94,7 +94,7 @@ You can now build your "simple-microservice" project and deploy it to Azure Spri
```bash ```bash
cd simple-microservice cd simple-microservice
./mvnw clean package ./mvnw clean package
az spring-cloud app deploy -n simple-microservice --jar-path target/demo-0.0.1-SNAPSHOT.jar az spring-cloud app deploy -n simple-microservice --artifact-path target/demo-0.0.1-SNAPSHOT.jar
cd .. cd ..
``` ```
@ -106,9 +106,8 @@ Go to [the Azure portal](https://portal.azure.com/?WT.mc_id=azurespringcloud-git
- Look for your Azure Spring Cloud instance in your resource group - Look for your Azure Spring Cloud instance in your resource group
- Click "Apps" in the "Settings" section of the navigation pane and select "simple-microservice" - Click "Apps" in the "Settings" section of the navigation pane and select "simple-microservice"
- Click on 'See more' to see "Test Endpoint" - Find the "Test endpoint" in the "Essentials" section.
![See More](media/02-seemore.png) ![Test endpoint](media/01-test-endpoint.png)
- Mouse over the URL labeled as "Test Endpoint" and click the clipboard icon that appears.
This will give you something like: This will give you something like:
`https://primary:BBQM6nsYnmmdQREXQINityNx63kWUbjsP7SIvqKhOcWDfP6HJTqg27klMLaSfpTB@rwo1106f.test.azuremicroservices.io/simple-microservice/default/` `https://primary:BBQM6nsYnmmdQREXQINityNx63kWUbjsP7SIvqKhOcWDfP6HJTqg27klMLaSfpTB@rwo1106f.test.azuremicroservices.io/simple-microservice/default/`
>💡 Note the text between `https://` and `@`. These are the basic authentication credentials, without which you will not be authorized to access the service. >💡 Note the text between `https://` and `@`. These are the basic authentication credentials, without which you will not be authorized to access the service.
@ -131,7 +130,7 @@ If you need to check your code, the final project is available in the ["simple-m
Here is the final script to build and deploy everything that was done in this guide: Here is the final script to build and deploy everything that was done in this guide:
``` ```
curl https://start.spring.io/starter.tgz -d dependencies=web -d baseDir=simple-microservice -d bootVersion=2.3.8 -d javaVersion=1.8 | tar -xzvf - curl https://start.spring.io/starter.tgz -d dependencies=web -d baseDir=simple-microservice -d bootVersion=2.6.1 -d javaVersion=11 | tar -xzvf -
cd simple-microservice cd simple-microservice
cat > HelloController.java << EOF cat > HelloController.java << EOF
package com.example.demo; package com.example.demo;
@ -149,9 +148,10 @@ public class HelloController {
} }
EOF EOF
mv HelloController.java src/main/java/com/example/demo/HelloController.java mv HelloController.java src/main/java/com/example/demo/HelloController.java
az spring-cloud app create -n simple-microservice az spring-cloud app create -n simple-microservice --runtime-version Java_11
./mvnw clean package ./mvnw clean package
az spring-cloud app deploy -n simple-microservice --jar-path target/demo-0.0.1-SNAPSHOT.jar az spring-cloud app deploy -n simple-microservice --artifact-path target/demo-0.0.1-SNAPSHOT.jar
cd ..
``` ```
--- ---

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 16 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 69 KiB

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 39 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 38 KiB

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 85 KiB