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-cloud/access-app-virtual-network.md
+67-66Lines changed: 67 additions & 66 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,34 +1,70 @@
1
1
---
2
2
title: "Azure Spring Cloud access app in virtual network"
3
-
description: Access app in an Azure Spring Cloud in virtual network.
3
+
description: Access app in Azure Spring Cloud in a virtual network.
4
4
author: karlerickson
5
5
ms.author: karler
6
6
ms.service: spring-cloud
7
7
ms.topic: how-to
8
-
ms.date: 11/11/2020
8
+
ms.date: 11/30/2021
9
9
ms.custom: devx-track-java
10
10
---
11
11
12
12
# Access your application in a private network
13
13
14
-
This document explains how to access an endpoint for your application in a private network. In order to get access, you need to create an **Azure Private DNS Zone** in your subscription to translate/resolve the private fully qualified domain name (FQDN) to its IP address.
14
+
This document explains how to access an endpoint for your application in a private network.
15
15
16
-
When **Assign Endpoint** for applications in an Azure Spring Cloud service instance is deployed in your virtual network, the endpoint is a private FQDN. The domain is only accessible in the private network. Apps and services use the application endpoint. They include the **Test Endpoint** described in [View apps and deployments](./how-to-staging-environment.md#view-apps-and-deployments). **Log streaming**, described in [Stream Azure Spring Cloud app logs in real-time](./how-to-log-streaming.md), also works only within the private network.
16
+
When **Assign Endpoint** on applications in an Azure Spring Cloud service instance is deployed in your virtual network, the endpoint is a private fully qualified domain name (FQDN). The domain is only accessible in the private network. Apps and services use the application endpoint. They include the *Test Endpoint* described in [View apps and deployments](./how-to-staging-environment.md#view-apps-and-deployments). *Log streaming*, described in [Stream Azure Spring Cloud app logs in real-time](./how-to-log-streaming.md), also works only within the private network.
17
+
18
+
## Find the IP for your application
19
+
20
+
#### [Portal](#tab/azure-portal)
21
+
22
+
1. Select the virtual network resource you created as explained in [Deploy Azure Spring Cloud in your Azure virtual network (VNet injection)](./how-to-deploy-in-azure-virtual-network.md).
23
+
24
+
2. In the **Connected devices** search box, enter *kubernetes-internal*.
25
+
26
+
3. In the filtered result, find the **Device** connected to the service runtime **Subnet** of the service instance, and copy its **IP Address**. In this sample, the IP Address is *10.1.0.7*.
27
+
28
+
[](media/spring-cloud-access-app-vnet/create-dns-record.png)
29
+
30
+
#### [CLI](#tab/azure-CLI)
31
+
32
+
Find the IP Address for your Spring Cloud services. Customize the value of your spring cloud name based on your real environment.
If you have your own DNS solution for your virtual network, like Active Directory Domain Controller, Infoblox, or another, you need to point the domain `*.private.azuremicroservices.io` to the [IP address](#find-the-ip-for-your-application). Otherwise, you can follow the following instructions to create an **Azure Private DNS Zone** in your subscription to translate/resolve the private fully qualified domain name (FQDN) to its IP address.
53
+
54
+
> [!NOTE]
55
+
> If you are using Azure China, please replace `private.azuremicroservices.io` with `private.microservices.azure.cn` in this documentation. Learn more about [Check Endpoints in Azure](/azure/china/resources-developer-guide#check-endpoints-in-azure).
17
56
18
57
## Create a private DNS zone
19
58
20
59
The following procedure creates a private DNS zone for an application in the private network.
21
60
22
61
#### [Portal](#tab/azure-portal)
23
62
24
-
1. Open the Azure portal. From the top search box, search for **Private DNS zones**, and select **Private DNS zones** from the result.
63
+
1. Open the Azure portal. From the top search box, search for **Private DNS zones**, and select **Private DNS zones** from the results.
25
64
26
65
2. On the **Private DNS zones** page, select **Add**.
27
66
28
-
3. Fill out the form on the **Create Private DNS zone** page. Enter **<span>private.azuremicroservices.io</span>** as the **Name** of the zone.
29
-
30
-
>[!NOTE]
31
-
> If you are using Azure China, please replace `private.azuremicroservices.io` with `private.microservices.azure.cn` for the whole documentation, [learn more](/azure/china/resources-developer-guide#check-endpoints-in-azure).
67
+
3. Fill out the form on the **Create Private DNS zone** page. Enter *private.azuremicroservices.io* as the **Name** of the zone.
32
68
33
69
4. Select **Review + Create**.
34
70
@@ -54,8 +90,9 @@ The following procedure creates a private DNS zone for an application in the pri
54
90
1. Create the private DNS zone.
55
91
56
92
```azurecli
57
-
az network private-dns zone create --resource-group $RESOURCE_GROUP \
58
-
--name private.azuremicroservices.io
93
+
az network private-dns zone create \
94
+
--resource-group $RESOURCE_GROUP \
95
+
--name private.azuremicroservices.io
59
96
```
60
97
61
98
---
@@ -68,13 +105,11 @@ To link the private DNS zone to the virtual network, you need to create a virtua
68
105
69
106
#### [Portal](#tab/azure-portal)
70
107
71
-
1. Select the private DNS zone resource created above: **<span>private.azuremicroservices.io</span>**
72
-
73
-
2. On the left pane, select **Virtual network links**.
108
+
1. Select the private DNS zone resource created above: *private.azuremicroservices.io*
74
109
75
-
3. Select**Add**.
110
+
2. On the left pane, select **Virtual network links**, then select**Add**.
76
111
77
-
4. Enter **azure-spring-cloud-dns-link** for the **Link name**.
112
+
4. Enter *azure-spring-cloud-dns-link* for the **Link name**.
78
113
79
114
5. For **Virtual network**, select the virtual network you created as explained in [Deploy Azure Spring Cloud in your Azure virtual network (VNet injection)](./how-to-deploy-in-azure-virtual-network.md).
80
115
@@ -84,16 +119,16 @@ To link the private DNS zone to the virtual network, you need to create a virtua
84
119
85
120
#### [CLI](#tab/azure-CLI)
86
121
87
-
Link the private DNS zone you just created to the virtual network holding your Azure Spring Cloud service.
122
+
Link the private DNS zone you created to the virtual network holding your Azure Spring Cloud service.
88
123
89
124
```azurecli
90
-
az network private-dns link vnet create --resource-group $RESOURCE_GROUP \
125
+
az network private-dns link vnet create \
126
+
--resource-group $RESOURCE_GROUP \
91
127
--name azure-spring-cloud-dns-link \
92
128
--zone-name private.azuremicroservices.io \
93
129
--virtual-network $VIRTUAL_NETWORK_NAME \
94
130
--registration-enabled false
95
131
```
96
-
97
132
---
98
133
99
134
## Create DNS record
@@ -102,62 +137,27 @@ To use the private DNS zone to translate/resolve DNS, you must create an "A" typ
102
137
103
138
#### [Portal](#tab/azure-portal)
104
139
105
-
1. Select the virtual network resource you created as explained in [Deploy Azure Spring Cloud in your Azure virtual network (VNet injection)](./how-to-deploy-in-azure-virtual-network.md).
106
-
107
-
2. In the **Connected devices** search box, enter *kubernetes-internal*.
108
-
109
-
3. In the filtered result, find the **Device** connected to the service runtime **Subnet** of the service instance, and copy its **IP Address**. In this sample, the IP Address is *10.1.0.7*.
110
-
111
-
[](media/spring-cloud-access-app-vnet/create-dns-record.png)
112
-
113
-
Or, you can fetch the IP using the following az CLI command:
114
-
115
-
```azurecli
116
-
SPRING_CLOUD_RG= # Resource group name of your Azure Spring Cloud service instance
117
-
SPRING_CLOUD= # Name of your Azure Spring Cloud service instance
118
-
119
-
SERVICE_RUNTIME_RG=`az spring-cloud show -g $SPRING_CLOUD_RG -n $SPRING_CLOUD --query \
After following the procedure in [Build and deploy microservice applications](./how-to-deploy-in-azure-virtual-network.md), you can assign private FQDN for your application.
174
+
After following the procedure in [Build and deploy microservice applications](./how-to-deploy-in-azure-virtual-network.md), you can assign a private FQDN for your application.
175
175
176
176
#### [Portal](#tab/azure-portal)
177
177
178
178
1. Select the Azure Spring Cloud service instance deployed in your virtual network, and open the **Apps** tab in the menu on the left.
179
179
180
180
2. Select the application to show the **Overview** page.
181
181
182
-
3. Select **Assign Endpoint** to assign a private FQDN to your application. This can take a few minutes.
182
+
3. Select **Assign Endpoint** to assign a private FQDN to your application. Assigning an FQDN can take a few minutes.
After the assignment, you can access the private FQDN of your application in private network. For example, you can create a jumpbox machine in the same virtual network, or a peered virtual network, and on that jumpbox machine the private FQDN is accessible.
205
+
After the assignment, you can access the private FQDN of your application in the private network. For example, you can create a jumpbox machine in the same virtual network, or a peered virtual network. Then on that jumpbox or virtual machine the private FQDN is accessible.
205
206
206
207

0 commit comments