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/container-apps/how-to-use-private-endpoint.md
+85-85Lines changed: 85 additions & 85 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -156,63 +156,63 @@ An environment in Azure Container Apps creates a secure boundary around a group
156
156
1. Create an Azure virtual network (VNet) to associate with the Container Apps environment. The VNet must have a subnet available for the environment deployment.
157
157
You can use an existing VNet, but private endpoints are only supported by workload profiles environments, which require a subnet with a minimum CIDR range of `/27` or larger. To learn more about subnet sizing, see the [networking architecture overview](./networking.md#subnet).
158
158
159
-
```azurecli
160
-
az network vnet create \
161
-
--resource-group $RESOURCE_GROUP \
162
-
--name $VNET_NAME \
163
-
--location $LOCATION \
164
-
--address-prefix 10.0.0.0/16
165
-
```
159
+
```azurecli
160
+
az network vnet create \
161
+
--resource-group $RESOURCE_GROUP \
162
+
--name $VNET_NAME \
163
+
--location $LOCATION \
164
+
--address-prefix 10.0.0.0/16
165
+
```
166
166
167
167
1. Create a subnet to associate with the VNet and to contain the private endpoint.
168
168
169
-
```azurecli
170
-
az network vnet subnet create \
171
-
--resource-group $RESOURCE_GROUP \
172
-
--vnet-name $VNET_NAME \
173
-
--name $SUBNET_NAME \
174
-
--address-prefixes 10.0.0.0/21
175
-
```
169
+
```azurecli
170
+
az network vnet subnet create \
171
+
--resource-group $RESOURCE_GROUP \
172
+
--vnet-name $VNET_NAME \
173
+
--name $SUBNET_NAME \
174
+
--address-prefixes 10.0.0.0/21
175
+
```
176
176
177
177
1. Retrieve the subnet ID. You use this to create the private endpoint.
178
178
179
-
```azurecli
180
-
SUBNET_ID=$(az network vnet subnet show \
181
-
--resource-group $RESOURCE_GROUP \
182
-
--vnet-name $VNET_NAME \
183
-
--name $SUBNET_NAME \
184
-
--query "id" \
185
-
--output tsv)
186
-
```
179
+
```azurecli
180
+
SUBNET_ID=$(az network vnet subnet show \
181
+
--resource-group $RESOURCE_GROUP \
182
+
--vnet-name $VNET_NAME \
183
+
--name $SUBNET_NAME \
184
+
--query "id" \
185
+
--output tsv)
186
+
```
187
187
188
188
## Create an environment
189
189
190
190
1. Create the Container Apps environment using the VNet deployed in the preceding steps. Private endpoints are only supported by workload profiles environments, which is the default type for new environments.
191
191
192
-
```azurecli
193
-
az containerapp env create \
194
-
--name $ENVIRONMENT_NAME \
195
-
--resource-group $RESOURCE_GROUP \
196
-
--location $LOCATION
197
-
```
192
+
```azurecli
193
+
az containerapp env create \
194
+
--name $ENVIRONMENT_NAME \
195
+
--resource-group $RESOURCE_GROUP \
196
+
--location $LOCATION
197
+
```
198
198
199
199
1. Retrieve the environment ID. You use this to configure the environment.
200
200
201
-
```azurecli
202
-
ENVIRONMENT_ID=$(az containerapp env show \
203
-
--resource-group $RESOURCE_GROUP \
204
-
--name $ENVIRONMENT_NAME \
205
-
--query "id" \
206
-
--output tsv)
207
-
```
201
+
```azurecli
202
+
ENVIRONMENT_ID=$(az containerapp env show \
203
+
--resource-group $RESOURCE_GROUP \
204
+
--name $ENVIRONMENT_NAME \
205
+
--query "id" \
206
+
--output tsv)
207
+
```
208
208
209
209
1. Disable public network access for the environment. This is needed to enable private endpoints.
210
210
211
-
```azurecli
212
-
az containerapp env update \
213
-
--id $ENVIRONMENT_ID \
214
-
--public-network-access Disabled
215
-
```
211
+
```azurecli
212
+
az containerapp env update \
213
+
--id $ENVIRONMENT_ID \
214
+
--public-network-access Disabled
215
+
```
216
216
217
217
## Create a private endpoint
218
218
@@ -233,51 +233,51 @@ az network private-endpoint create \
233
233
234
234
1. Retrieve the private endpoint IP address. You use this to add a DNS record to your private DNS zone.
235
235
236
-
```azurecli
237
-
PRIVATE_ENDPOINT_IP_ADDRESS=$(az network private-endpoint show \
238
-
--name $PRIVATE_ENDPOINT \
239
-
--resource-group $RESOURCE_GROUP \
240
-
--query 'customDnsConfigs[0].ipAddresses[0]' \
241
-
--output tsv)
242
-
```
236
+
```azurecli
237
+
PRIVATE_ENDPOINT_IP_ADDRESS=$(az network private-endpoint show \
238
+
--name $PRIVATE_ENDPOINT \
239
+
--resource-group $RESOURCE_GROUP \
240
+
--query 'customDnsConfigs[0].ipAddresses[0]' \
241
+
--output tsv)
242
+
```
243
243
244
244
1. Retrieve the environment default domain. You use this to add a DNS record to your private DNS zone.
245
245
246
-
```azurecli
247
-
DNS_RECORD_NAME=$(az containerapp env show \
248
-
--id $ENVIRONMENT_ID \
249
-
--query 'properties.defaultDomain' \
250
-
--output tsv | sed 's/\..*//')
251
-
```
246
+
```azurecli
247
+
DNS_RECORD_NAME=$(az containerapp env show \
248
+
--id $ENVIRONMENT_ID \
249
+
--query 'properties.defaultDomain' \
250
+
--output tsv | sed 's/\..*//')
251
+
```
252
252
253
253
1. Create a private DNS zone.
254
254
255
-
```azurecli
256
-
az network private-dns zone create \
257
-
--resource-group $RESOURCE_GROUP \
258
-
--name $PRIVATE_DNS_ZONE
259
-
```
255
+
```azurecli
256
+
az network private-dns zone create \
257
+
--resource-group $RESOURCE_GROUP \
258
+
--name $PRIVATE_DNS_ZONE
259
+
```
260
260
261
261
1. Create a link between your VNet and your private DNS zone.
262
262
263
-
```azurecli
264
-
az network private-dns link vnet create \
265
-
--resource-group $RESOURCE_GROUP \
266
-
--zone-name $PRIVATE_DNS_ZONE \
267
-
--name $DNS_LINK \
268
-
--virtual-network $VNET_NAME \
269
-
--registration-enabled false
270
-
```
263
+
```azurecli
264
+
az network private-dns link vnet create \
265
+
--resource-group $RESOURCE_GROUP \
266
+
--zone-name $PRIVATE_DNS_ZONE \
267
+
--name $DNS_LINK \
268
+
--virtual-network $VNET_NAME \
269
+
--registration-enabled false
270
+
```
271
271
272
272
1. Add a record for your private endpoint to your private DNS zone.
273
273
274
-
```azurecli
275
-
az network private-dns record-set a add-record \
276
-
--resource-group $RESOURCE_GROUP \
277
-
--zone-name $PRIVATE_DNS_ZONE \
278
-
--record-set-name $DNS_RECORD_NAME \
279
-
--ipv4-address $PRIVATE_ENDPOINT_IP_ADDRESS
280
-
```
274
+
```azurecli
275
+
az network private-dns record-set a add-record \
276
+
--resource-group $RESOURCE_GROUP \
277
+
--zone-name $PRIVATE_DNS_ZONE \
278
+
--record-set-name $DNS_RECORD_NAME \
279
+
--ipv4-address $PRIVATE_ENDPOINT_IP_ADDRESS
280
+
```
281
281
282
282
## Deploy a container app
283
283
@@ -404,21 +404,21 @@ The administrator password has the following requirements:
404
404
405
405
1. In PowerShell, run the following command. Replace the \<PLACEHOLDERS\> with your values.
406
406
407
-
```powershell
408
-
nslookup <CONTAINER_APP_ENDPOINT>
409
-
```
407
+
```powershell
408
+
nslookup <CONTAINER_APP_ENDPOINT>
409
+
```
410
410
411
-
The output is similar to the following example, with your values replacing the \<PLACEHOLDERS\>.
411
+
The output is similar to the following example, with your values replacing the \<PLACEHOLDERS\>.
0 commit comments