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
|**Container Apps environment**| Select the **Create new** link to create a new environment. |
117
+
118
+
1. In the *Create Container Apps environment* window, enter the following values.
119
+
120
+
| Property | Value |
121
+
|---|---|
122
+
|**Environment name**| Enter **my-environment**. |
123
+
|**Zone redundancy**| Select **Disabled**. |
124
+
125
+
Select the **Create** button, and thenselectthe**Container** tab.
126
+
127
+
1. In *Container* tab, enter the following values.
128
+
129
+
| Property | Value |
130
+
|---|---|
131
+
|**Name**| Enter **sample-admin-client**. |
132
+
|**Image source**| Select **Docker Hub or other registries**. |
133
+
|**Image type**| Select **Public**. |
134
+
|**Registry login server**| Enter **mcr.microsoft.com**. |
135
+
|**Image and tag**| Enter **javacomponents/samples/sample-admin-for-spring-client:latest**. |
136
+
137
+
Select the **Ingress** tab.
138
+
139
+
1. In *Ingress* tab, enter the following and leave the rest of the form with their default values.
140
+
141
+
| Property | Value |
142
+
|---|---|
143
+
|**Ingress**| Select **Enabled**. |
144
+
|**Ingress traffic**| Select **Accept traffic from anywhere**. |
145
+
|**Ingress type**| Select **HTTP**. |
146
+
|**Target port**| Enter **8080**. |
147
+
148
+
Select **Review + create**.
149
+
150
+
1. Once the validation checks pass, select**Create** to create your container app.
151
+
152
+
---
153
+
99
154
## Use the component
100
155
156
+
### [Azure CLI](#tab/azure-cli)
157
+
101
158
Now that you have an existing environment, you can create your container app and bind it to a Java component instance of Admin for Spring component.
102
159
103
160
1. Create the Admin for Spring Java component.
@@ -122,6 +179,33 @@ Now that you have an existing environment, you can create your container app and
122
179
--max-replicas 2
123
180
```
124
181
182
+
### [Azure portal](#tab/azure-portal)
183
+
184
+
Now that you have an existing environment and admin client container app, you can create a Java component instance of Admin for Spring.
185
+
186
+
1. Go to your container app's environment in the portal.
187
+
188
+
1. From the left menu, under *Services* category, select **Services**.
189
+
190
+
1. Select **+ Configure** drop down, and select **Java component**.
191
+
192
+
1. In the *Configure Java component* panel, enter the following values.
193
+
194
+
| Property | Value |
195
+
|---|---|
196
+
| **Java component type** | Select **Admin for Spring**. |
197
+
| **Java component name** | Enter **admin**. |
198
+
199
+
1. Select **Next**.
200
+
201
+
1. On the *Review* tab, select **Configure**.
202
+
203
+
---
204
+
205
+
## Bind your container app to the Admin for Spring Java component
206
+
207
+
### [Azure CLI](#tab/azure-cli)
208
+
125
209
1. Create the container app and bind to the Admin for Spring.
126
210
127
211
```azurecli
@@ -137,17 +221,64 @@ Now that you have an existing environment, you can create your container app and
137
221
--bind $JAVA_COMPONENT_NAME
138
222
```
139
223
140
-
The `--bind` parameter binds the container app to the Admin for Spring Java component. The container app can now read the configuration values from environment variables, primarily the `SPRING_BOOT_ADMIN_CLIENT_URL` property and connect to the Admin for Spring.
224
+
### [Azure portal](#tab/azure-portal)
141
225
142
-
The binding also injects the following property:
226
+
1. Go to your container app environment in the portal.
1. From the left menu, under *Services* category, select **Services**.
229
+
230
+
1. From the list, select **admin**.
231
+
232
+
1. Under *Bindings*, select the *App name* drop-down and select **sample-admin-client**.
233
+
234
+
1. Select the **Review** tab.
235
+
236
+
1. Select the **Configure** button.
237
+
238
+
1. Return to your container app in the portal and copy the URL of your app to a text editor so you can use it in a coming step.
239
+
240
+
---
241
+
242
+
The bind operation binds the container app to the Admin for Spring Java component. The container app can now read the configuration values from environment variables, primarily the `SPRING_BOOT_ADMIN_CLIENT_URL` property and connect to the Admin for Spring.
This property indicates that the Admin for Spring component client should prefer the IP address of the container app instance when connecting to the Admin for Spring server.
250
+
This property indicates that the Admin for Spring component client should prefer the IP address of the container app instance when connecting to the Admin for Spring server.
149
251
150
-
You can also [remove a binding](java-admin-for-spring-usage.md#unbind) from your application.
252
+
## (Optional) Unbind your container app from the Admin for Spring Java component
253
+
254
+
### [Azure CLI](#tab/azure-cli)
255
+
256
+
To remove a binding from a container app, use the `--unbind` option.
257
+
258
+
``` azurecli
259
+
az containerapp update \
260
+
--name $APP_NAME \
261
+
--unbind $JAVA_COMPONENT_NAME \
262
+
--resource-group $RESOURCE_GROUP
263
+
```
264
+
265
+
### [Azure portal](#tab/azure-portal)
266
+
267
+
1. Go to your container app environment in the portal.
268
+
269
+
1. From the left menu, under *Services* category, select **Services**.
270
+
271
+
1. From the list, select **admin**.
272
+
273
+
1. Under *Bindings*, find the line for *sample-admin-client* select and select **Delete**.
Copy file name to clipboardExpand all lines: articles/container-apps/java-eureka-server.md
+2-6Lines changed: 2 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -122,7 +122,7 @@ Use the following steps to create each of the resources necessary to create a co
122
122
123
123
| Property | Value |
124
124
|---|---|
125
-
|**Name**| Enter **my-config-client**. |
125
+
|**Name**| Enter **my-eureka-client**. |
126
126
|**Image source**| Select **Docker Hub or other registries**. |
127
127
|**Image type**| Select **Public**. |
128
128
|**Registry login server**| Enter **mcr.microsoft.com**. |
@@ -174,8 +174,6 @@ Now that you have an existing environment, you can create your container app and
174
174
175
175
Now that you have an existing environment and eureka client container app, you can create a Java component instance of Eureka Server for Spring.
176
176
177
-
Now that you have an existing environment and config server client container app, you can create a Java component instance of Config Server for Spring.
178
-
179
177
1. Go to your container app's environment in the portal.
180
178
181
179
1. From the left menu, under *Services* category, select **Services**.
@@ -189,8 +187,6 @@ Now that you have an existing environment and config server client container app
189
187
| **Java component type** | Select **Eureka Server for Spring**. |
190
188
| **Java component name** | Enter **eureka**. |
191
189
192
-
1. In the *Bindings* section, select the *App name* drop-down and select **my-component-app**.
193
-
194
190
1. Select **Next**.
195
191
196
192
1. On the *Review* tab, select **Configure**.
@@ -255,7 +251,7 @@ The `eureka.client.register-with-eureka` property is set to `true` to enforce re
255
251
256
252
The `eureka.instance.prefer-ip-address` is set to `true` due to the specific DNS resolution rule in the container app environment. Don't modify this value so you don't break the binding.
257
253
258
-
## Unbind your container app from the Eureka Server for Spring Java component
254
+
## (Optional) Unbind your container app from the Eureka Server for Spring Java component
0 commit comments