Skip to content

Commit e85890f

Browse files
committed
edits
1 parent b8dcd07 commit e85890f

File tree

4 files changed

+66
-49
lines changed

4 files changed

+66
-49
lines changed

articles/spring-apps/includes/quickstart-deploy-restful-api-app/clean-up-resources.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ ms.date: 10/02/2023
77
---
88

99
<!--
10-
For clarity of structure, a separate markdown file is used to describe how to clean up resources using Azure Portal, AZD or Azure Cli.
10+
For clarity of structure, a separate markdown file is used to describe how to clean up resources using Azure Portal, AZD, or Azure Cli.
1111
12-
[!INCLUDE [clean-up-resources-portal-or-azd](includes/quickstart-deploy-restful-api-app/clean-up-resources.md)]
12+
[!INCLUDE [clean-up-resources](includes/quickstart-deploy-restful-api-app/clean-up-resources.md)]
1313
1414
-->
1515

articles/spring-apps/includes/quickstart-deploy-restful-api-app/deploy-restful-api-app-with-enterprise-plan.md

Lines changed: 59 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ export USER_PRINCIPAL_NAME=<user-principal-name>
126126

127127
### 3.2. Create a new resource group
128128

129-
Use the following steps to create a new resource group.
129+
Use the following steps to create a new resource group:
130130

131131
1. Use the following command to sign in to the Azure CLI:
132132

@@ -168,10 +168,10 @@ Use the following steps to create a new resource group.
168168

169169
Use the following commands to install the Azure Spring Apps extension for the Azure CLI and register the `Microsoft.SaaS` namespace:
170170

171-
```azurecli
172-
az extension add --name spring --upgrade
173-
az provider register --namespace Microsoft.SaaS
174-
```
171+
```azurecli
172+
az extension add --name spring --upgrade
173+
az provider register --namespace Microsoft.SaaS
174+
```
175175

176176
### 3.4. Create an Azure Spring Apps instance
177177

@@ -204,24 +204,24 @@ Use the following commands to install the Azure Spring Apps extension for the Az
204204

205205
### 3.5. Prepare the PostgreSQL instance
206206

207-
The Spring web app uses H2 for the database in localhost, and Azure Database for PostgreSQL for the database in Azure.
207+
The Spring web app uses H2 for the database in localhost and Azure Database for PostgreSQL for the database in Azure.
208208

209209
Use the following command to create a PostgreSQL instance:
210210

211-
```azurecli
212-
az postgres flexible-server create \
213-
--name ${POSTGRESQL_SERVER} \
214-
--database-name ${POSTGRESQL_DB} \
215-
--admin-user ${POSTGRESQL_ADMIN_USERNAME} \
216-
--admin-password ${POSTGRESQL_ADMIN_PASSWORD} \
217-
--public-access 0.0.0.0
218-
```
211+
```azurecli
212+
az postgres flexible-server create \
213+
--name ${POSTGRESQL_SERVER} \
214+
--database-name ${POSTGRESQL_DB} \
215+
--admin-user ${POSTGRESQL_ADMIN_USERNAME} \
216+
--admin-password ${POSTGRESQL_ADMIN_PASSWORD} \
217+
--public-access 0.0.0.0
218+
```
219219

220220
Specifying `0.0.0.0` enables public access from any resources deployed within Azure to access your server.
221221

222222
### 3.6. Connect app instance to PostgreSQL instance
223223

224-
After the application instance and the PostgreSQL instance are created, the application instance can't access the PostgreSQL instance directly. Use the following steps to enable the app to connect to the PostgreSQL instance.
224+
After the application instance and the PostgreSQL instance are created, the application instance can't access the PostgreSQL instance directly. Use the following steps to enable the app to connect to the PostgreSQL instance:
225225

226226
1. Use the following command to get the PostgreSQL instance's fully qualified domain name:
227227

@@ -245,10 +245,13 @@ After the application instance and the PostgreSQL instance are created, the appl
245245

246246
### 3.7. Expose RESTful APIs
247247

248+
Use the following steps to expose the RESTful APIs:
249+
248250
1. Use the following command to create a Microsoft Entra ID application:
249251

250252
```azurecli
251-
az ad app create --display-name ${TODO_APP_NAME} \
253+
az ad app create \
254+
--display-name ${TODO_APP_NAME} \
252255
--sign-in-audience AzureADandPersonalMicrosoftAccount \
253256
--identifier-uris ${TODO_APP_URL}
254257
```
@@ -307,8 +310,9 @@ After the application instance and the PostgreSQL instance are created, the appl
307310
1. Use the following command to add scopes:
308311

309312
```azurecli
310-
az ad app update --id ${TODO_APP_URL} \
311-
--set api="$api"
313+
az ad app update \
314+
--id ${TODO_APP_URL} \
315+
--set api="$api"
312316
```
313317

314318
1. Use the following command to get the tenant ID to use in the next step:
@@ -320,9 +324,10 @@ After the application instance and the PostgreSQL instance are created, the appl
320324
1. Use the following command to get the application ID to use in the next steps:
321325

322326
```azurecli
323-
appid=$(az ad app show --id ${TODO_APP_URL} \
324-
--query appId \
325-
--output tsv);
327+
appid=$(az ad app show \
328+
--id ${TODO_APP_URL} \
329+
--query appId \
330+
--output tsv);
326331
echo $appid
327332
```
328333

@@ -351,13 +356,13 @@ You can now deploy the app to Azure Spring Apps.
351356

352357
Use the following command to deploy the app based on source code:
353358

354-
```azurecli
355-
az spring app deploy \
359+
```azurecli
360+
az spring app deploy \
356361
--service ${AZURE_SPRING_APPS_NAME} \
357362
--name ${APP_NAME} \
358363
--build-env BP_JVM_VERSION=17 \
359364
--source-path .
360-
```
365+
```
361366

362367
---
363368

@@ -377,18 +382,24 @@ The RESTful APIs act as a resource server, which is protected by Microsoft Entra
377382

378383
#### Register the client application
379384

385+
Use the following steps to register the client application:
386+
380387
1. Use the following command to create a Microsoft Entra ID application, which is used to add the permissions for the `ToDo` app:
381388

382389
```azurecli
383-
az ad app create --display-name ${TODOWEB_APP_NAME} \
390+
az ad app create \
391+
--display-name ${TODOWEB_APP_NAME} \
384392
--sign-in-audience AzureADMyOrg \
385393
--identifier-uris ${TODOWEB_APP_URL}
386394
```
387395

388396
1. Use the following command to add permissions:
389397

390398
```azurecli
391-
az ad app permission add --id api://simple-todowebtest2 --api $appid --api-permissions $permissionid1=Scope $permissionid2=Scope $permissionid3=Scope
399+
az ad app permission add \
400+
--id api://simple-todowebtest2 \
401+
--api $appid \
402+
--api-permissions $permissionid1=Scope $permissionid2=Scope $permissionid3=Scope
392403
```
393404

394405
1. Use the following command to grant admin consent for the permissions you added:
@@ -400,44 +411,50 @@ The RESTful APIs act as a resource server, which is protected by Microsoft Entra
400411
1. Use the following command to get the client ID of the `ToDoWeb` app used in the [Obtain the access token](#obtain-the-access-token) step:
401412

402413
```azurecli
403-
az ad app show --id ${TODOWEB_APP_URL} \
404-
--query appId \
405-
--output tsv
414+
az ad app show \
415+
--id ${TODOWEB_APP_URL} \
416+
--query appId \
417+
--output tsv
406418
```
407419

408420
#### Add user to access the RESTful APIs
409421

410-
1. Use the following steps to create a member user in your Microsoft Entra tenant. Then, the user can manage the data of the `ToDo` application through RESTful APIs:
422+
Use the following command to create a member user in your Microsoft Entra tenant. Then, the user can manage the data of the `ToDo` application through RESTful APIs:
411423

412-
```azurecli
413-
az ad user create --display-name ${NEW_MEMBER_USERNAME} \
414-
--password ${NEW_MEMBER_PASSWORD} \
415-
--user-principal-name ${USER_PRINCIPAL_NAME}
416-
```
424+
```azurecli
425+
az ad user create \
426+
--display-name ${NEW_MEMBER_USERNAME} \
427+
--password ${NEW_MEMBER_PASSWORD} \
428+
--user-principal-name ${USER_PRINCIPAL_NAME}
429+
```
417430

418431
#### Update the OAuth2 configuration for Swagger UI authorization
419432

433+
Use the following steps to update the OAuth2 configuration:
434+
420435
1. Use the following command to get the object ID of the `ToDoWeb` app:
421436

422437
```azurecli
423438
az ad app show --id ${TODOWEB_APP_URL} --query id
424439
```
425440

426-
1. Use the following command to get the url of your `simple-todo-api` app:
441+
1. Use the following command to get the URL of your `simple-todo-api` app:
427442

428443
```azurecli
429-
az spring app show --name ${APP_NAME} \
444+
az spring app show \
445+
--name ${APP_NAME} \
430446
--service ${AZURE_SPRING_APPS_NAME} \
431447
--query properties.url
432448
```
433449

434-
1. Use the following command to update the OAuth2 configuration for Swagger UI authorization, replace **\<object-id>** and **\<url>** with the parameters you got. Then, you can authorize users to acquire access tokens through the `ToDoWeb` app.
450+
1. Use the following command to update the OAuth2 configuration for Swagger UI authorization, replacing the `<object-id>` and `<URL>` placeholders with the parameter values you got. Then, you can authorize users to acquire access tokens through the `ToDoWeb` app.
435451

436452
```azurecli
437-
az rest --method PATCH \
438-
--uri "https://graph.microsoft.com/v1.0/applications/<object-id>" \
439-
--headers 'Content-Type=application/json' \
440-
--body '{"spa":{"redirectUris":["<url>/swagger-ui/oauth2-redirect.html"]}}'
453+
az rest \
454+
--method PATCH \
455+
--uri "https://graph.microsoft.com/v1.0/applications/<object-id>" \
456+
--headers 'Content-Type=application/json' \
457+
--body '{"spa":{"redirectUris":["<URL>/swagger-ui/oauth2-redirect.html"]}}'
441458
```
442459

443460
---

articles/spring-apps/includes/quickstart-deploy-restful-api-app/validate-the-app-portal.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ You can now access the RESTful API to see if it works.
1717

1818
### 5.1. Request an access token
1919

20-
The RESTful APIs act as a resource server, which is protected by Microsoft Entra ID. Before acquiring an access token, you're required to register another application in Microsoft Entra ID and grant permissions to the client application, which is named `ToDoWeb`.
20+
The RESTful APIs act as a resource server, which is protected by Microsoft Entra ID. Before acquiring an access token, you must register another application in Microsoft Entra ID and grant permissions to the client application, which is named `ToDoWeb`.
2121

2222
#### Register the client application
2323

@@ -72,6 +72,6 @@ Use the following steps to update the OAuth2 configuration for Swagger UI author
7272

7373
1. Under **Manage**, select **Authentication**, select **Add a platform**, and then select **Single-page application**.
7474

75-
1. Use the format `<your-app-exposed-application-url-or-endpoint>/swagger-ui/oauth2-redirect.html` as the OAuth2 redirect URL in the **Redirect URIs** field, and then select **Configure**.
75+
1. Use the format `<your-app-exposed-application-URL-or-endpoint>/swagger-ui/oauth2-redirect.html` as the OAuth2 redirect URL in the **Redirect URIs** field, and then select **Configure**.
7676

7777
:::image type="content" source="../../media/quickstart-deploy-restful-api-app/single-page-app-authentication.png" alt-text="Screenshot of the Azure portal that shows the Authentication page for Microsoft Entra ID." lightbox="../../media/quickstart-deploy-restful-api-app/single-page-app-authentication.png":::

articles/spring-apps/quickstart-deploy-restful-api-app.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ The following diagram shows the architecture of the system:
4747
- Global Administrator or Privileged Role Administrator, for granting consent for apps requesting any permission, for any API.
4848
- Cloud Application Administrator or Application Administrator, for granting consent for apps requesting any permission for any API, except Microsoft Graph app roles (application permissions).
4949
- A custom directory role that includes the [permission to grant permissions to applications](/entra/identity/role-based-access-control/custom-consent-permissions), for the permissions required by the application.
50-
For more information, see [grant admin consent](/entra/identity/enterprise-apps/grant-admin-consent?pivots=portal#prerequisites).
50+
For more information, see [Grant tenant-wide admin consent to an application](/entra/identity/enterprise-apps/grant-admin-consent?pivots=portal).
5151
- If you're deploying an Azure Spring Apps Enterprise plan instance for the first time in the target subscription, see the [Requirements](./how-to-enterprise-marketplace-offer.md#requirements) section of [Enterprise plan in Azure Marketplace](./how-to-enterprise-marketplace-offer.md).
5252
- [Git](https://git-scm.com/downloads).
5353
- [Java Development Kit (JDK)](/java/azure/jdk/), version 17.
@@ -60,7 +60,7 @@ For more information, see [grant admin consent](/entra/identity/enterprise-apps/
6060
- Global Administrator or Privileged Role Administrator, for granting consent for apps requesting any permission, for any API.
6161
- Cloud Application Administrator or Application Administrator, for granting consent for apps requesting any permission for any API, except Microsoft Graph app roles (application permissions).
6262
- A custom directory role that includes the [permission to grant permissions to applications](/entra/identity/role-based-access-control/custom-consent-permissions), for the permissions required by the application.
63-
For more information, see [grant admin consent](/entra/identity/enterprise-apps/grant-admin-consent?pivots=portal#prerequisites).
63+
For more information, see [Grant tenant-wide admin consent to an application](/entra/identity/enterprise-apps/grant-admin-consent?pivots=portal).
6464
- If you're deploying an Azure Spring Apps Enterprise plan instance for the first time in the target subscription, see the [Requirements](./how-to-enterprise-marketplace-offer.md#requirements) section of [Enterprise plan in Azure Marketplace](./how-to-enterprise-marketplace-offer.md).
6565
- [Git](https://git-scm.com/downloads).
6666
- [Java Development Kit (JDK)](/java/azure/jdk/), version 17.
@@ -80,7 +80,7 @@ For more information, see [grant admin consent](/entra/identity/enterprise-apps/
8080
- Global Administrator or Privileged Role Administrator, for granting consent for apps requesting any permission, for any API.
8181
- Cloud Application Administrator or Application Administrator, for granting consent for apps requesting any permission for any API, except Microsoft Graph app roles (application permissions).
8282
- A custom directory role that includes the [permission to grant permissions to applications](/entra/identity/role-based-access-control/custom-consent-permissions), for the permissions required by the application.
83-
For more information, see [grant admin consent](/entra/identity/enterprise-apps/grant-admin-consent?pivots=portal#prerequisites).
83+
For more information, see [Grant tenant-wide admin consent to an application](/entra/identity/enterprise-apps/grant-admin-consent?pivots=portal).
8484
- [Git](https://git-scm.com/downloads).
8585
- [Java Development Kit (JDK)](/java/azure/jdk/), version 17.
8686
- A Microsoft Entra tenant. For instructions on creating one, see [Quickstart: Create a new tenant in Microsoft Entra ID](../active-directory/fundamentals/create-new-tenant.md).

0 commit comments

Comments
 (0)