You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/spring-apps/includes/tutorial-authenticate-client-with-gateway/authenticate-client-with-gateway-consumption-plan.md
+27-29Lines changed: 27 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ For clarity of structure, a separate markdown file is used to describe how to de
15
15
16
16
## 2. Prepare the Spring project
17
17
18
-
Use the following steps to clone and run the app locally.
18
+
Use the following steps to clone and run the app locally:
19
19
20
20
1. Use the following command to clone the sample project from GitHub:
21
21
@@ -54,16 +54,14 @@ Use the following steps to create a service instance:
54
54
55
55
:::image type="content" source="../../media/tutorial-authenticate-client-with-gateway/create-service-instance.png" alt-text="Screenshot of the Azure portal that shows the Create a resource page with Azure Spring Apps highlighted." lightbox="../../media/tutorial-authenticate-client-with-gateway/create-service-instance.png":::
56
56
57
-
1. Fill out the **Basics** form with the following information:
58
-
59
-
Use the following table as a guide for completing the form. The recommended **Plan** is `Standard consumption & dedicated (preview)`.
57
+
1. Fill out the **Basics** form. Use the following table as a guide for completing the form. The recommended value for **Plan** is **Standard consumption & dedicated (preview)**.
| Subscription | Your subscription name | The Azure subscription that you want to use for your server. If you have multiple subscriptions, choose the subscription in which you'd like to be billed for the resource. |
64
62
| Resource group |*myresourcegroup*| A new resource group name or an existing one from your subscription. |
65
63
| Name |*myasa*| A unique name that identifies your Azure Spring Apps service. 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. |
66
-
| Plan |*Standard consumption & dedicated (preview)*| The pricing plan determines the resources and cost associated with your instance. |
64
+
| Plan |**Standard consumption & dedicated (preview)**| The pricing plan determines the resources and cost associated with your instance. |
67
65
| Region | The region closest to your users | The location that is closest to your users. |
68
66
| Container Apps Environment |*myacaenv*| Select which Container Apps environment instance to share the same virtual network with other services and resources. |
69
67
@@ -74,15 +72,15 @@ Use the following steps to create a service instance:
| Environment name |*myacaenv*| A unique name that identifies your Azure Container Apps Environment service. |
77
-
| Plan |*Consumption*| The pricing plan determines the resources and cost associated with your instance. |
78
-
| Zone Redundant |*Disabled*| Whether to create your Container Apps Environment service in an Azure availability zone. |
75
+
| Plan |**Consumption**| The pricing plan determines the resources and cost associated with your instance. |
76
+
| Zone Redundant |**Disabled**| Whether to create your Container Apps Environment service in an Azure availability zone. |
79
77
80
-
:::image type="content" source="../../media/tutorial-authenticate-client-with-gateway/create-apps-container-env-basics.png" alt-text="Screenshot of the Azure portal that shows the Create Azure Container Apps page." lightbox="../../media/tutorial-authenticate-client-with-gateway/create-apps-container-env-basics.png":::
78
+
:::image type="content" source="../../media/tutorial-authenticate-client-with-gateway/create-apps-container-environment-basics.png" alt-text="Screenshot of the Azure portal that shows the Create Azure Container Apps page." lightbox="../../media/tutorial-authenticate-client-with-gateway/create-apps-container-environment-basics.png":::
81
79
82
80
> [!IMPORTANT]
83
81
> The Consumption workload profile has a pay-as-you-go billing model, with no starting cost. You're billed for the dedicated workload profile based on the provisioned resources. For more information, see [Workload profiles in Consumption + Dedicated plan structure environments in Azure Container Apps (preview)](../../../container-apps/workload-profiles-overview.md) and [Azure Spring Apps pricing](https://azure.microsoft.com/pricing/details/spring-apps/).
84
82
85
-
4. Select **Review and Create** to review your selections. Select **Create** to provision the Azure Spring Apps instance.
83
+
1. Select **Review and Create** to review your selections. Select **Create** to provision the Azure Spring Apps instance.
86
84
87
85
1. On the toolbar, select the **Notifications** icon (a bell) to monitor the deployment process. After the deployment is done, you can select **Pin to dashboard**, which creates a tile for this service on your Azure portal dashboard as a shortcut to the service's **Overview** page. Select **Go to resource** to open the service's **Overview** page.
88
86
@@ -98,17 +96,17 @@ Use the following steps to create a service instance:
98
96
99
97
### 3.3. Register the Books application
100
98
101
-
This section provides the steps to register an application to add app roles in Azure AD, which is used for protecting the RESTful APIs in Azure Spring Apps.
99
+
This section provides the steps to register an application to add app roles in Microsoft Entra ID, which is used for protecting the RESTful APIs in Azure Spring Apps.
102
100
103
101
1. Go to the Azure portal homepage.
104
102
105
103
1. If you have access to multiple tenants, use the **Directory + subscription** filter (:::image type="icon" source="../../media/tutorial-authenticate-client-with-gateway/portal-directory-subscription-filter.png" border="false":::) to select the tenant in which you want to register an application.
106
104
107
-
1. Search for and Select**Azure Active Directory**.
105
+
1. Search for and select**Azure Active Directory**.
108
106
109
107
1. Under **Manage**, select **App registrations** > **New registration**.
110
108
111
-
1. Enter a name for your application in the **Name** field, for example `Books`. Users of your app might see this name, and you can change it later.
109
+
1. Enter a name for your application in the **Name** field, for example *Books*. Users of your app might see this name, and you can change it later.
112
110
113
111
1. For **Supported account types**, select **Accounts in this organizational directory only**.
114
112
@@ -122,18 +120,18 @@ This section provides the steps to register an application to add app roles in A
122
120
123
121
1. Under **Manage**, select **App roles** > **Create app role**, and then enter the following information:
124
122
125
-
- For **Display name**, enter `Write`.
123
+
- For **Display name**, enter *Write*.
126
124
- For **Allowed member types**, select **Applications**.
127
-
- For **Value**, enter `Books.Write`.
128
-
- For **Description**, enter `Adding books`.
125
+
- For **Value**, enter *Books.Write*.
126
+
- For **Description**, enter *Adding books*.
129
127
130
128
1. Repeat the previous step to add another app role: `Books.Read`.
131
129
132
130
:::image type="content" source="../../media/tutorial-authenticate-client-with-gateway/app-roles.png" alt-text="Screenshot of the Books app registration page that shows the App roles." lightbox="../../media/tutorial-authenticate-client-with-gateway/app-roles.png":::
133
131
134
132
### 3.4. Register the SPA application
135
133
136
-
The Books RESTful API app acts as a resource server, which is protected by Azure AD. Before acquiring an access token, it's required to register another application in Azure AD and grant permissions to the client application, which is named `SPA`.
134
+
The Books RESTful API app acts 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 `SPA`.
137
135
138
136
1. Go back to your tenant in **Azure Active Directory**.
139
137
@@ -147,21 +145,21 @@ The Books RESTful API app acts as a resource server, which is protected by Azure
147
145
148
146
1. On the app **Overview** page, look for the **Application (client) ID** value, and then record it for later use. You need it to acquire access token.
149
147
150
-
1. Select **API permissions** > **Add a permission** > **APIs my organization uses**. Select the `Books` application that you registered earlier, select the Permissions**Books.Read** and **Books.Write**, and then select **Add permissions**.
148
+
1. Select **API permissions** > **Add a permission** > **APIs my organization uses**. Select the `Books` application that you registered earlier, select the permissions**Books.Read** and **Books.Write**, and then select **Add permissions**.
151
149
152
-
1. Select **Grant admin consent for {your-tenant-name}** to grant admin consent for the permissions you added.
150
+
1. Select **Grant admin consent for \<your-tenant-name>** to grant admin consent for the permissions you added.
153
151
154
152
:::image type="content" source="../../media/tutorial-authenticate-client-with-gateway/api-permissions.png" alt-text="Screenshot of the SPA API permissions page that shows the API permissions of a web application." lightbox="../../media/tutorial-authenticate-client-with-gateway/api-permissions.png":::
155
153
156
-
1. Navigate to **Certificates & secrets**, and then select **New client secret**.
154
+
1. Navigate to **Certificates & secrets** and then select **New client secret**.
157
155
158
156
1. On the **Add a client secret** page, enter a description for the secret, select an expiration date, and then select **Add**.
159
157
160
-
1. Look for the **Value** of the secret, and then record it for later use. You need it to acquire access token.
158
+
1. Look for the **Value** of the secret and then record it for later use. You need it to acquire an access token.
161
159
162
160
### 3.5. Update the configuration of Books Service app
163
161
164
-
Update the configuration of `spring.cloud.azure.active-directory` in the `books-service` application configuration file. Be sure to replace the placeholders with your own values you created in the previous step.
162
+
Update the configuration of `spring.cloud.azure.active-directory` in the `books-service` application configuration file to match the following example. Be sure to replace the placeholders with your own values you created in the previous step.
165
163
166
164
```yaml
167
165
spring:
@@ -185,21 +183,21 @@ The following steps show you how to deploy the apps to Azure.
185
183
186
184
### 4.1. Deploy the microservice apps to Azure Spring Apps
187
185
188
-
Use the [Maven plugin for Azure Spring Apps](https://github.com/microsoft/azure-maven-plugins/wiki/Azure-Spring-Apps) to deploy the apps to Azure Spring Apps.
186
+
Use the following steps to deploy the apps to Azure Spring Apps using the [Maven plugin for Azure Spring Apps](https://github.com/microsoft/azure-maven-plugins/wiki/Azure-Spring-Apps):
189
187
190
-
1. Navigate to the sample project directory and execute the following command to config the app in Azure Spring Apps:
188
+
1. Navigate to the sample project directory and then use the following command to configure the app in Azure Spring Apps:
The following list describes the command interactions:
197
195
198
-
-**Select child modules to configure(input numbers separated by comma, eg: [1-2,4,6], ENTER to select ALL)**: Press <kbd>Enter</kbd> to select all.
196
+
-**Select child modules to configure(input numbers separated by comma, eg: [1-2,4,6], ENTER to select ALL)**: Press <kbd>Enter</kbd> to select all.
199
197
-**OAuth2 login**: Authorize the login to Azure based on the OAuth2 protocol.
200
198
-**Select subscription**: Select the subscription list number of the Azure Spring Apps instance you created, which defaults to the first subscription in the list. If you use the default number, press <kbd>Enter</kbd> directly.
201
199
-**Select Azure Spring Apps for deployment**: Select the list number of the Azure Spring Apps instance you created. If you use the default number, press <kbd>Enter</kbd> directly.
202
-
-**Select apps to expose public access:(input numbers separated by comma, eg: [1-2,4,6], ENTER to select NONE)**: Enter *1* for `gateway-service`.
200
+
-**Select apps to expose public access:(input numbers separated by comma, eg: [1-2,4,6], ENTER to select NONE)**: Enter *1* for `gateway-service`.
203
201
-**Confirm to save all the above configurations (Y/n)**: Enter <kbd>y</kbd>. If you enter <kbd>n</kbd>, the configuration isn't saved in the POM files.
204
202
205
203
1. Use the following command to deploy the app:
@@ -208,11 +206,11 @@ Use the [Maven plugin for Azure Spring Apps](https://github.com/microsoft/azure-
208
206
./mvnw azure-spring-apps:deploy
209
207
```
210
208
211
-
The following list describes the command interactions:
209
+
The following list describes the command interaction:
212
210
213
211
-**OAuth2 login**: You need to authorize the login to Azure based on the OAuth2 protocol.
214
212
215
-
After the command is executed, you can see the following log signs that the deployment was successful.
213
+
After the command is executed, you can see the following log messages, which indicate that the deployment was successful.
216
214
217
215
```output
218
216
[INFO] Getting public url of app(gateway-service)...
@@ -227,9 +225,9 @@ Use the [Maven plugin for Azure Spring Apps](https://github.com/microsoft/azure-
227
225
228
226
The output **Application url** is the base endpoint to access the ToDo RESTful API application.
229
227
230
-
### 4.2. Deploy the SPA app locally
228
+
### 4.2. Run the SPA app locally
231
229
232
-
Update the configuration in the `SPA` application script file `spa/server.js`. Be sure to replace the placeholders with your own values you created in the previous step.
230
+
Update the configuration in the `SPA` application script file *spa/server.js* to match the following example. Be sure to replace the placeholders with your own values you created in the previous step.
233
231
234
232
```javascript
235
233
constSpringCloudGatewayURL="<URL exposed by app gateway-service>"
This quickstart shows you how to secure communication between a client application and a microservice application that is hosted on Azure Spring Apps and shielded with a Spring Cloud Gateway app. The client application is verified as a security principal to initiate contact with the microservice deployed on Azure Spring Apps, using the app built with [Spring Cloud Gateway](https://docs.spring.io/spring-cloud-gateway/docs/current/reference/html/). This method employs Spring Cloud Gateway's Token Relay and Spring Security's Resource Server features for the processes of authentication and authorization, realized through the execution of the [OAuth 2.0 client credentials flow](../active-directory/develop/v2-oauth2-client-creds-grant-flow.md).
23
23
24
-
The following list shows the composition of a sample project:
24
+
The following list shows the composition of the sample project:
25
25
26
26
- Books SPA: This Single Page Application (SPA), hosted locally, interacts with the Books microservice for adding or searching for books.
27
27
- Books microservice:
@@ -33,7 +33,7 @@ The following list shows the composition of a sample project:
33
33
- An Azure subscription. If you don't have a subscription, create a [free account](https://azure.microsoft.com/free/) before you begin.
34
34
-[Git](https://git-scm.com/downloads).
35
35
-[Java Development Kit (JDK)](/java/azure/jdk/), version 17.
36
-
-An Azure AD tenant. For more information on how to create an Azure AD tenant, see [Quickstart: Create a new tenant in Azure AD](../active-directory/fundamentals/create-new-tenant.md).
36
+
-A Microsoft Entra ID tenant. For more information on how to create a Microsoft Entra ID tenant, see [Quickstart: Create a new tenant in Azure AD](../active-directory/fundamentals/create-new-tenant.md).
37
37
-[Azure CLI](/cli/azure/install-azure-cli) version 2.45.0 or higher.
38
38
- Install [Node.js](https://nodejs.org).
39
39
@@ -45,7 +45,7 @@ You can access the Books SPA app that communicates with the Books RESTful APIs t
45
45
46
46
1. Go to `http://localhost:3000` in your browser to access the application.
47
47
48
-
1. Enter an **Author** and a **Title**, and then select **Add Book**. You'll see a response similar to the following example:
48
+
1. Enter values for **Author** and **Title**, and then select **Add Book**. You see a response similar to the following example:
49
49
50
50
```output
51
51
Book added successfully: {"id":1,"author":"Jeff Black","title":"Spring In Action"}
@@ -71,7 +71,7 @@ You can access the Books SPA app that communicates with the Books RESTful APIs t
71
71
> [Use managed identities for applications in Azure Spring Apps](./how-to-use-managed-identities.md)
0 commit comments