Skip to content

Commit 72e485a

Browse files
authored
Merge pull request #231444 from rambotzhong/rambotzhong/quickstart-access-app-within-vnet
Release PR for "feat: doc for accessing apps in vnet #229033"
2 parents 7ba294c + f262983 commit 72e485a

File tree

2 files changed

+94
-0
lines changed

2 files changed

+94
-0
lines changed
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
---
2+
title: Access applications using Azure Spring Apps Standard consumption plan in a virtual network
3+
description: Learn how to access applications in a virtual network that are using the Azure Spring Apps Standard consumption plan.
4+
author: karlerickson
5+
ms.author: haojianzhong
6+
ms.service: spring-apps
7+
ms.topic: quickstart
8+
ms.date: 03/21/2023
9+
ms.custom: devx-track-java
10+
---
11+
12+
# Access applications using Azure Spring Apps Standard consumption plan in a virtual network
13+
14+
This article describes how to access your application in a virtual network using Azure Spring Apps Standard Consumption plan.
15+
16+
When you create an Azure Container Apps environment in an existing virtual network, you can access all the apps inside the environment only within that virtual network. In addition, when you create an instance of Azure Spring Apps inside the Azure Container Apps environment, you can access the applications in the Azure Spring Apps instance only from the virtual network. For more information, see [Provide a virtual network to an internal Azure Container Apps environments](/azure/container-apps/vnet-custom-internal?tabs=bash&pivots=azure-portal).
17+
18+
## Create a private DNS zone
19+
20+
Create a private DNS zone named as the Azure Container App environment’s default domain `<UNIQUE_IDENTIFIER>.<REGION_NAME>.azurecontainerapps.io`, with an A record.
21+
22+
Use the following command to get the default domain of Azure Container Apps environment.
23+
24+
```azurecli
25+
az containerapp env show \
26+
--resource-group <resource-group-name> \
27+
--name <Azure-Container-Apps-environment-name> \
28+
--query 'properties.defaultDomain'
29+
```
30+
31+
Use the following command to create a Private DNS Zone for applications in the virtual network.
32+
33+
```azurecli
34+
az network private-dns zone create \
35+
--resource-group <resource-group-name> \
36+
--name <private-dns-zone-name>
37+
```
38+
39+
## Create an A record
40+
41+
Create an A record that contains the name `<DNS Suffix>` and the static IP address of the Azure Container Apps environment.
42+
43+
Use the following command to get the static IP address for an Azure Container Apps environment.
44+
45+
```azurecli
46+
az containerapp env show \
47+
--resource-group <resource-group-name> \
48+
--name <Azure-Container-Apps-environment-name> \
49+
--query 'properties.staticIp'
50+
```
51+
52+
Use the following command to get the A record:
53+
54+
```azurecli
55+
az network private-dns record-set a add-record \
56+
--resource-group <resource-group-name> \
57+
--zone-name <private-dns-zone-name> \
58+
--record-set-name '*' \
59+
--ipv4-address <static-ip>
60+
```
61+
62+
## Link the virtual network
63+
64+
Use the following command to create a virtual network link to the private DNS zone of the virtual network.
65+
66+
```azurecli
67+
az network private-dns link vnet create \
68+
--resource-group <resource-group-name> \
69+
--name <link-name> \
70+
--zone-name <private-dns-zone-name> \
71+
--virtual-network <virtual-network-name> \
72+
--registration-enabled false
73+
```
74+
75+
## Access the application
76+
77+
Now you can access an application in an Azure Spring Apps instance within your virtual network, using the URL of the application.
78+
79+
## Clean up resources
80+
81+
Be sure to delete the resources you created in this article when you no longer need them. To delete the resources, just delete the resource group that contains them. You can delete the resource group using the Azure portal. Alternately, to delete the resource group by using Azure CLI, use the following commands:
82+
83+
```azurecli
84+
echo "Enter the Resource Group name:" &&
85+
read resourceGroupName &&
86+
az group delete --name $resourceGroupName &&
87+
echo "Press [ENTER] to continue ..."
88+
```
89+
90+
## Next steps
91+
92+
- [Azure Spring Apps documentation](./index.yml)

articles/spring-apps/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ items:
2525
href: quickstart-provision-app-environment-with-virtual-network.md
2626
- name: Launch your first event-driven app
2727
href: quickstart-deploy-event-driven-app-standard-consumption.md
28+
- name: Access apps in a VNet
29+
href: quickstart-access-within-virtual-network.md
2830
- name: Run apps on Basic/Standard tier
2931
expanded: true
3032
items:

0 commit comments

Comments
 (0)