Skip to content

Commit 7523029

Browse files
Merge pull request #297350 from craigshoemaker/aca/jason/aft-portal-steps
[Container Apps] New: Add AFD portal steps
2 parents 3c620cc + 9982470 commit 7523029

File tree

4 files changed

+195
-52
lines changed

4 files changed

+195
-52
lines changed

articles/container-apps/how-to-integrate-with-azure-front-door.md

Lines changed: 156 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,154 @@ author: craigshoemaker
66
ms.service: azure-container-apps
77
ms.custom: devx-track-azurepowershell, devx-track-azurecli, ignite-2024
88
ms.topic: how-to
9-
ms.date: 02/03/2025
9+
ms.date: 03/31/2025
1010
ms.author: cshoe
11+
zone_pivot_groups: azure-cli-or-portal
1112
---
1213

1314
# Create a private link to an Azure Container App with Azure Front Door (preview)
1415

1516
In this article, you learn how to connect directly from Azure Front Door to your Azure Container Apps using a private link instead of the public internet. In this tutorial, you create an Azure Container Apps workload profiles environment, an Azure Front Door, and connect them securely through a private link. You then verify the connectivity between your container app and the Azure Front Door.
1617

18+
::: zone pivot="azure-portal"
19+
20+
## Prerequisites
21+
22+
- Azure account with an active subscription.
23+
- If you don't have one, you [can create one for free](https://azure.microsoft.com/free/).
24+
25+
- This feature is only supported for workload profile environments.
26+
27+
- Make sure the `Microsoft.Cdn` resource provider is registered for your subscription.
28+
1. Begin by signing in to the [Azure portal](https://portal.azure.com).
29+
1. Browse to your subscription page and select **Settings** > **Resource providers**.
30+
1. Select **Microsoft.Cdn** from the provider list.
31+
1. Select **Register**.
32+
33+
## Create a container app
34+
35+
Create a resource group to organize the services related to your container app deployment.
36+
37+
1. Search for **Container Apps** in the top search bar.
38+
1. Select **Container Apps** in the search results.
39+
1. Select the **Create** button.
40+
41+
1. In the *Create Container App* page, in the *Basics* tab, do the following actions.
42+
43+
| Setting | Action |
44+
|---|---|
45+
| Subscription | Select your Azure subscription. |
46+
| Resource group | Select the **Create new resource group** link and enter **my-container-apps**. |
47+
| Container app name | Enter **my-container-app**. |
48+
| Deployment source | Select **Container image**. |
49+
| Region | Select **Central US**. |
50+
51+
1. In the *Create Container Apps Environment* field, select the **Create new environment** link.
52+
53+
1. In the *Create Container Apps Environment* page, in the *Basics* tab, enter the following values:
54+
55+
| Setting | Value |
56+
|--|--|
57+
| Environment name | Enter **my-environment**. |
58+
| Zone redundancy | Select **Disabled** |
59+
60+
1. Select the **Networking** tab.
61+
62+
1. Set *Public Network Access* to **Disable: Block all incoming traffic from the public internet.**
63+
64+
1. Leave **Use your own virtual network** set to **No**.
65+
66+
1. Leave **Enable private endpoints** set to **No**.
67+
68+
1. Select **Create**.
69+
70+
1. In the *Create Container App* page, select the **Container** tab.
71+
72+
1. Select **Use quickstart image**.
73+
74+
<!-- Deploy the container app -->
75+
[!INCLUDE [container-apps-create-portal-deploy.md](../../includes/container-apps-create-portal-deploy.md)]
76+
77+
3. When you browse to the container app endpoint, you see the following message:
78+
79+
```
80+
The public network access on this managed environment is disabled. To connect to this managed environment, please use the Private Endpoint from inside your virtual network. To learn more https://aka.ms/PrivateEndpointTroubleshooting.
81+
```
82+
83+
Instead, you use an Azure Front Door endpoint to access your container app.
84+
85+
## Create an Azure Front Door profile and endpoint
86+
87+
1. Search for **Front Door** in the top search bar.
88+
1. Select **Front Door and CDN profiles** in the search results.
89+
1. Select **Azure Front Door** and **Quick Create**.
90+
1. Select the **Continue to create a Front Door** button.
91+
92+
1. In the *Create a Front Door profile* page, in the *Basics* tab, do the following actions.
93+
94+
| Setting | Actions |
95+
|--|--|
96+
| Resource group | Select **my-container-apps**. |
97+
| Name | Enter **my-afd-profile**. |
98+
| Tier | Select **Premium**. Private link isn't supported for origins for Azure Front Door on the Standard tier. |
99+
| Endpoint name | Enter **my-afd-endpoint**. |
100+
| Origin type | Select **Container Apps**. |
101+
| Origin host name | Enter the hostname of your container app. Your hostname looks like the following example: `my-container-app.orangeplant-77e5875b.centralus.azurecontainerapps.io`. |
102+
| Enable private link service | Enable this setting. |
103+
| Region | Select **(US) Central US**. |
104+
| Target sub resource | Select **managedEnvironments**. |
105+
| Request message | Enter **AFD Private Link Request**. |
106+
107+
1. Select **Review + create**.
108+
109+
1. Select **Create**.
110+
111+
1. After the deployment completes, select **Go to resource**.
112+
113+
1. In the *Front Door and CDN profile* overview page, find your *Endpoint hostname*. It looks like the following example. Make a note of this hostname.
114+
115+
```
116+
my-afd-endpoint.<HASH>.b01.azurefd.net
117+
```
118+
119+
## Approve the private endpoint connection request
120+
121+
1. Browse to the overview page for the environment named *my-environment* you created previously.
122+
123+
1. Expand **Settings** > **Networking**.
124+
125+
1. You see a link for the private endpoint connection requests. For example, `1 private endpoint`. Select this link.
126+
127+
1. In the *Private endpoint connections* page, approve each private endpoint connection request with the description `AFD Private Link Request`.
128+
129+
> [!NOTE]
130+
> Azure Front Door has a known issue where it might create multiple private endpoint connection requests.
131+
132+
## Access your container app from Azure Front Door
133+
134+
Browse to the Azure Front Door endpoint hostname you recorded previously. You see the output for the quickstart container app image. Global deployment could take a few minutes to deploy, so if you don't see the expected output, wait a few minutes and then refresh.
135+
136+
## Clean up resources
137+
138+
If you're not going to continue to use this application, you can delete the container app and all the associated services by removing the resource group.
139+
140+
1. Select the **my-container-apps** resource group from the *Overview* section.
141+
1. Select the **Delete resource group** button at the top of the resource group *Overview*.
142+
1. Enter the resource group name **my-container-apps** in the *Are you sure you want to delete "my-container-apps"* confirmation dialog.
143+
1. Select **Delete**.
144+
145+
The process to delete the resource group could take a few minutes to complete.
146+
147+
::: zone-end
148+
149+
::: zone pivot="azure-cli"
150+
17151
## Prerequisites
18152
19153
- Azure account with an active subscription.
20154
- If you don't have one, you [can create one for free](https://azure.microsoft.com/free/).
21155
22-
- This feature is only available with the [Azure CLI](/cli/azure/install-azure-cli). To ensure you're running the latest version of the Azure CLI, run the following command.
156+
- To ensure you're running the latest version of the [Azure CLI](/cli/azure/install-azure-cli), run the following command.
23157
24158
```azurecli
25159
az upgrade
@@ -77,7 +211,7 @@ az group create \
77211
--location $LOCATION
78212
```
79213
80-
1. Retrieve the environment ID. You use this to configure the environment.
214+
1. Retrieve the environment ID. You use this ID to configure the environment.
81215
82216
```azurecli
83217
ENVIRONMENT_ID=$(az containerapp env show \
@@ -121,11 +255,17 @@ az group create \
121255
--output tsv)
122256
```
123257
124-
If you browse to the container app endpoint, you receive `ERR_CONNECTION_CLOSED` because the container app environment has public access disabled. Instead, you use an AFD endpoint to access your container app.
258+
1. When you browse to the container app endpoint, you receive `ERR_CONNECTION_CLOSED` because the container app environment has public access disabled. Instead, you use an AFD endpoint to access your container app.
125259
126260
## Create an Azure Front Door profile
127261
128-
Create an AFD profile. Private link is not supported for origins in an AFD profile with SKU `Standard_AzureFrontDoor`.
262+
1. Make sure the `Microsoft.Cdn` resource provider is registered for your subscription.
263+
264+
```azurecli
265+
az provider register --namespace Microsoft.Cdn
266+
```
267+
268+
1. Create an AFD profile. Private link isn't supported for origins in an AFD profile with SKU `Standard_AzureFrontDoor`.
129269
130270
```azurecli
131271
az afd profile create \
@@ -202,23 +342,23 @@ az afd origin create \
202342
/subscriptions/<SUBSCRIPTION_ID>/resourceGroups/<RESOURCE_GROUP>/providers/Microsoft.App/managedEnvironments/my-environment/privateEndpointConnections/<PRIVATE_ENDPOINT_CONNECTION_ID>
203343
```
204344
205-
Don't confuse this with the private endpoint ID, which looks like the following.
345+
Don't confuse this ID with the private endpoint ID, which looks like the following.
206346
207347
```
208348
/subscriptions/<SUBSCRIPTION_ID>/resourceGroups/eafd-Prod-centralus/providers/Microsoft.Network/privateEndpoints/<PRIVATE_ENDPOINT_ID>
209349
```
210350
211351
## Approve the private endpoint connection
212352
213-
Run the following command to approve the connection. Replace the \<PLACEHOLDER\> with the private endpoint connection resource ID you recorded in the previous section.
353+
To approve the connection, run the following command. Replace the \<PLACEHOLDER\> with the private endpoint connection resource ID you recorded in the previous section.
214354
215355
```azurecli
216356
az network private-endpoint-connection approve --id <PRIVATE_ENDPOINT_CONNECTION_RESOURCE_ID>
217357
```
218358

219359
## Add a route
220360

221-
Run the following command to map the endpoint you created earlier to the origin group. Private endpoints on Azure Container Apps only support inbound HTTP traffic. TCP traffic is not supported.
361+
Run the following command to map the endpoint you created earlier to the origin group. Private endpoints on Azure Container Apps only support inbound HTTP traffic. TCP traffic isn't supported.
222362

223363
```azurecli
224364
az afd route create \
@@ -254,19 +394,24 @@ az afd route create \
254394
255395
1. Browse to the hostname. You see the output for the quickstart container app image.
256396
257-
It takes a few minutes for your AFD profile to be deployed globally, so if you do not see the expected output at first, wait a few minutes and then refresh.
397+
If you don't see the expected output at first, wait a few minutes and then refresh.
258398
259399
## Clean up resources
260400
261-
If you're not going to continue to use this application, you can remove the **my-container-apps** resource group. This deletes the Azure Container Apps instance and all associated services. It also deletes the resource group that the Container Apps service automatically created and which contains the custom network components.
401+
If you're not going to continue to use this application, you can remove the **my-container-apps** resource group. This action deletes the Azure Container Apps instance and all associated services. It also deletes the resource group that the Container Apps service automatically created and which contains the custom network components.
262402
263403
> [!CAUTION]
264-
> The following command deletes the specified resource group and all resources contained within it. If resources outside the scope of this guide exist in the specified resource group, they will also be deleted.
404+
> The following command deletes the specified resource group and all resources contained within it. If resources outside the scope of this guide exist in the specified resource group, they'll also be deleted.
265405
266406
```azurecli
267407
az group delete --name $RESOURCE_GROUP
268408
```
269409

410+
::: zone-end
411+
412+
> [!TIP]
413+
> Having issues? Let us know on GitHub by opening an issue in the [Azure Container Apps repo](https://github.com/microsoft/azure-container-apps).
414+
270415
## Related content
271416

272417
- [Azure Private Link](/azure/private-link/private-link-overview)

0 commit comments

Comments
 (0)