Skip to content

Commit 2ab49b2

Browse files
Merge pull request #1 from craigshoemaker/aca/spring-boot-admin
[Container Apps] Copy edit: Spring Boot Admin/Eureka component
2 parents d7aaff9 + 109479b commit 2ab49b2

File tree

8 files changed

+191
-165
lines changed

8 files changed

+191
-165
lines changed

articles/container-apps/java-admin-eureka-integration.md

Lines changed: 36 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
---
2-
title: "Tutorial: Integrate Admin for Spring with Eureka Server for Spring in Azure Container Apps"
2+
title: "Tutorial: Integrate Admin for Spring with Eureka Server for Spring in Azure Container Apps (preview)"
33
description: Learn to integrate Admin for Spring with Eureka Server for Spring in Azure Container Apps.
44
services: container-apps
55
author:
66
ms.service: container-apps
77
ms.custom: devx-track-extended-java
88
ms.topic: conceptual
9-
ms.date: 05/24/2024
9+
ms.date: 07/08/2024
1010
ms.author:
1111
---
1212

13-
# Tutorial: Integrate Admin for Spring with Eureka Server for Spring in Azure Container Apps (Preview)
13+
# Tutorial: Integrate Admin for Spring with Eureka Server for Spring in Azure Container Apps (preview)
1414

1515
This tutorial will guide you through the process of integrating a managed Admin for Spring with a Eureka Server for Spring within Azure Container Apps.
1616

@@ -38,13 +38,7 @@ To complete this tutorial, you need the following items:
3838

3939
When running managed Java components in Azure Container Apps, be aware of the following details:
4040

41-
| Item | Explanation |
42-
|---|---|
43-
| **Scope** | The Java components run in the same environment as the connected container apps. |
44-
| **Scaling** | Both the Eureka Server and Admin for Spring have fixed scaling properties (`minReplicas` and `maxReplicas` set to `1`). |
45-
| **Resources** | The resource allocation for both components is fixed. Each is allocated 0.5 CPU cores and 1Gi of memory. |
46-
| **Pricing** | Billing falls under consumption-based pricing. Resources consumed by managed Java components are billed at active/idle rates. You can delete components that are no longer in use to stop billing. |
47-
| **Binding** | Container apps connect to managed Java components via a binding, which injects configurations into container app environment variables. |
41+
[!INCLUDE [container-apps/component-considerations.md](../../includes/container-apps/component-considerations.md)]
4842

4943
## Setup
5044

@@ -90,9 +84,12 @@ Before you begin, create the necessary resources by executing the following comm
9084
az containerapp env create \
9185
--name $ENVIRONMENT \
9286
--resource-group $RESOURCE_GROUP \
93-
--location $LOCATION
87+
--location $LOCATION \
88+
--query "properties.provisioningState"
9489
```
9590

91+
Using the `--query` parameter filters the response down to a simple success or failure message.
92+
9693
## Optional: Create the Eureka Server for Spring
9794

9895
1. If you don't have an existing Eureka Server for Spring, follow the command below to create the Eureka Server Java component. For more information, see [Create the Eureka Server for Spring](java-eureka-server.md#Create-the-Eureka-Server-for-Spring-Java-component).
@@ -104,7 +101,7 @@ Before you begin, create the necessary resources by executing the following comm
104101
--name $EUREKA_COMPONENT_NAME
105102
```
106103
107-
## Create the Admin for Spring and bind it to the Eureka Server for Spring
104+
## Bind the components together
108105
109106
1. Create the Admin for Spring Java component.
110107
@@ -116,12 +113,10 @@ Before you begin, create the necessary resources by executing the following comm
116113
--bind $EUREKA_COMPONENT_NAME
117114
```
118115
119-
120-
## Bind Other Applications to the Eureka Server
116+
## Bind other apps to the Eureka Server
121117
122118
With the Eureka Server set up, you can now bind other applications to it for service discovery. And you can also monitor and manage these applications in the dashboard of Admin for Spring. Follow the steps below to create and bind a container app to the Eureka Server:
123119
124-
125120
1. Create the container app and bind it to the Eureka Server.
126121
127122
```azurecli
@@ -139,7 +134,7 @@ With the Eureka Server set up, you can now bind other applications to it for ser
139134
140135
> [!TIP] Since the Admin for Spring has been binded to the Eureka Server for Spring in previous steps. Bind the container app to the Eureka Server Java component will enable service discovery and allow to be managed through the Admin for Spring dashboard at the same time.
141136
142-
## View the application in both Admin for Spring and Eureka Server for Spring dashboards
137+
## View the dashboards
143138
144139
> [!IMPORTANT]
145140
> To view the dashboard, you need to have at least the `Microsoft.App/managedEnvironments/write` role assigned to your account on the managed environment resource. You can either explicitly assign `Owner` or `Contributor` role on the resource or follow the steps to create a custom role definition and assign it to your account.
@@ -154,53 +149,54 @@ With the Eureka Server set up, you can now bind other applications to it for ser
154149
"Actions": [
155150
"Microsoft.App/managedEnvironments/write"
156151
],
157-
"AssignableScopes": ["/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"]
152+
"AssignableScopes": ["/subscriptions/<SUBSCRIPTION_ID>"]
158153
}'
159154
```
160155
161-
Please replace the `AssignableScopes` value with your subscription id.
162-
156+
Make sure to replace placeholder in between the `<>` brackets in the `AssignableScopes` value with your subscription ID.
163157
164-
1. Assign the Custom Role to your accound on managed environment resource.
158+
1. Assign the custom role to your account on managed environment resource.
165159
166160
Get the resource id of the managed environment.
167161
168162
```azurecli
169-
export ENVIRONMENT_ID=$(az containerapp env show \
170-
--name $ENVIRONMENT --resource-group $RESOURCE_GROUP \
171-
--query id -o tsv)
163+
export ENVIRONMENT_ID=$(az containerapp env show \
164+
--name $ENVIRONMENT --resource-group $RESOURCE_GROUP \
165+
--query id -o tsv)
172166
```
173167
174168
1. Assign the role to the your account.
175-
169+
170+
Before running this command, replace the placeholder in between the `<>` brackets with your user or service principal ID.
171+
176172
```azurecli
177-
az role assignment create \
178-
--assignee <user-or-service-principal-id> \
179-
--role "Java Component Dashboard Access" \
180-
--scope $ENVIRONMENT_ID
173+
az role assignment create \
174+
--assignee <USER_OR_SERVICE_PRINCIPAL_ID> \
175+
--role "Java Component Dashboard Access" \
176+
--scope $ENVIRONMENT_ID
181177
```
182178
183179
1. Get the URL of the Admin for Spring dashboard.
184180
185181
```azurecli
186-
az containerapp env java-component admin-for-spring show \
187-
--environment $ENVIRONMENT \
188-
--resource-group $RESOURCE_GROUP \
189-
--name $ADMIN_COMPONENT_NAME \
190-
--query properties.ingress.fqdn -o tsv
182+
az containerapp env java-component admin-for-spring show \
183+
--environment $ENVIRONMENT \
184+
--resource-group $RESOURCE_GROUP \
185+
--name $ADMIN_COMPONENT_NAME \
186+
--query properties.ingress.fqdn -o tsv
191187
```
192188
193189
1. Get the URL of the Eureka Server for Spring dashboard.
194190
195191
```azurecli
196-
az containerapp env java-component eureka-server-for-spring show \
197-
--environment $ENVIRONMENT \
198-
--resource-group $RESOURCE_GROUP \
199-
--name $EUREKA_COMPONENT_NAME \
200-
--query properties.ingress.fqdn -o tsv
192+
az containerapp env java-component eureka-server-for-spring show \
193+
--environment $ENVIRONMENT \
194+
--resource-group $RESOURCE_GROUP \
195+
--name $EUREKA_COMPONENT_NAME \
196+
--query properties.ingress.fqdn -o tsv
201197
```
202198
203-
You should be able to access the Admin for Spring dashboard and the Eureka Server for Spring dashboard using the URLs provided. And the container app as well as the Admin for Spring server should be visible in both dashboards like screenshots below:
199+
This command returns the URL you can use to access the Eureka Server for Spring dashboard. Through the dashboard, you container app is also to you as shown in the following screenshot.
204200
205201
:::image type="content" source="media/java-components/sba.png" alt-text="Screenshot of the Admin for Spring dashboard." lightbox="media/java-components/sba.png":::
206202
@@ -211,7 +207,7 @@ With the Eureka Server set up, you can now bind other applications to it for ser
211207
The resources created in this tutorial have an effect on your Azure bill. If you aren't going to use these services long-term, run the following command to remove everything created in this tutorial.
212208

213209
```azurecli
214-
az group delete \
210+
az group delete \
215211
--resource-group $RESOURCE_GROUP
216212
```
217213

0 commit comments

Comments
 (0)