Skip to content

Commit 0c0c7ce

Browse files
authored
Merge pull request #297844 from cachai2/network-refactor
Network refactor
2 parents 949242a + 9a465bd commit 0c0c7ce

22 files changed

+531
-426
lines changed

articles/container-apps/TOC.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -356,12 +356,10 @@
356356
href: microservices-dapr-bindings.md
357357
- name: Microservices communication using Dapr Service Invocation
358358
href: microservices-dapr-service-invoke.md
359-
- name: Networking, ingress, and network security
359+
- name: Networking and ingress
360360
items:
361-
- name: Architecture overview
361+
- name: Overview
362362
href: networking.md
363-
- name: Use a custom virtual network
364-
href: vnet-custom.md
365363
- name: Ingress
366364
items:
367365
- name: Overview
@@ -385,8 +383,18 @@
385383
- name: CORS
386384
href: cors.md
387385
displayName: Cross origin resource sharing
388-
- name: Security
386+
- name: Virtual network configuration
387+
href: custom-virtual-networks.md
388+
- name: Managing outbound connections with Azure Firewall
389+
href: use-azure-firewall.md
390+
- name: Private endpoints and DNS
391+
href: private-endpoints-with-dns.md
392+
- name: Securing a custom VNET with an NSG
393+
href: firewall-integration.md
394+
- name: Tutorials
389395
items:
396+
- name: Use a custom virtual network
397+
href: vnet-custom.md
390398
- name: Configure WAF Application Gateway
391399
href: waf-app-gateway.md
392400
- name: Enable User Defined Routes (UDR)
@@ -395,10 +403,8 @@
395403
items:
396404
- name: Use rule-based routing
397405
href: rule-based-routing.md
398-
- name: Configure a custom domain
406+
- name: Use a custom domain with rule-based routing
399407
href: rule-based-routing-custom-domain.md
400-
- name: Securing a custom VNET with an NSG
401-
href: firewall-integration.md
402408
- name: Use a private endpoint
403409
href: how-to-use-private-endpoint.md
404410
- name: Use mTLS

articles/container-apps/billing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ The following resources are free during each calendar month, per subscription:
4242
Free usage doesn't appear on your bill. You're only charged as your resource usage exceeds the monthly free grants amounts.
4343

4444
> [!NOTE]
45-
> If you use Container Apps with [your own virtual network](networking.md#managed-resources) or your apps utilize other Azure resources, additional charges may apply.
45+
> If you use Container Apps with [your own virtual network](custom-virtual-networks.md#managed-resources) or your apps utilize other Azure resources, additional charges may apply.
4646
4747
### Resource consumption charges
4848

articles/container-apps/blue-green-deployment.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ms.author: ruslany
1414
zone_pivot_groups: azure-cli-bicep
1515
---
1616

17-
# Blue-Green Deployment in Azure Container Apps
17+
# Blue-green deployment in Azure Container Apps
1818

1919
[Blue-Green Deployment](https://martinfowler.com/bliki/BlueGreenDeployment.html) is a software release strategy that aims to minimize downtime and reduce the risk associated with deploying new versions of an application. In a blue-green deployment, two identical environments, referred to as "blue" and "green," are set up. One environment (blue) is running the current application version and one environment (green) is running the new application version.
2020

articles/container-apps/custom-domains-certificates.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ Azure Container Apps allows you to bind one or more custom domains to a containe
114114
1. Once the operation is complete, you see your domain name in the list of custom domains with a status of *Secured*. Navigate to your domain to verify that it's accessible.
115115

116116
> [!NOTE]
117-
> For container apps in internal Container Apps environments, [extra configuration](./networking.md#dns) is required to use custom domains with VNET-scope ingress.
117+
> For container apps in internal Container Apps environments, [extra configuration](./private-endpoints-with-dns.md) is required to use custom domains with VNET-scope ingress.
118118
119119
::: zone-end
120120

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
---
2+
title: Configuring virtual networks Azure Container Apps environments
3+
description: Learn how to configure virtual networks in Azure Container Apps.
4+
services: container-apps
5+
author: craigshoemaker
6+
ms.service: azure-container-apps
7+
ms.topic: conceptual
8+
ms.date: 05/01/2025
9+
ms.author: cshoe
10+
---
11+
12+
# Virtual network configuration
13+
14+
A virtual network creates a secure boundary around your Azure Container Apps [environment](environment.md). By default, environments are created with a VNet that is automatically generated. However, using an existing VNet provides more Azure networking features such as integration with Application Gateway, Network Security Groups, and communication with resources behind private endpoints. This configuration is important for enterprise customers who need to isolate internal, mission-critical applications from the public internet.
15+
16+
As you create a virtual network, keep in mind the following situations:
17+
18+
- If you want your container app to restrict all outside access, create an [internal Container Apps environment](networking.md#accessibility-level).
19+
20+
- If you use your own VNet, you need to provide a subnet dedicated exclusively to your container app. This subnet isn't available to other services.
21+
22+
- Network addresses are assigned from a subnet range you define as the environment is created.
23+
24+
- You can define the subnet range used by the Container Apps environment.
25+
26+
- You can restrict inbound requests to the environment exclusively to the VNet by deploying the environment as [internal](vnet-custom.md).
27+
28+
> [!NOTE]
29+
> When you provide your own virtual network, additional [managed resources](custom-virtual-networks.md#managed-resources) are created. These resources incur costs at their associated rates.
30+
31+
As you begin to design the network around your container app, refer to [Plan virtual networks](../virtual-network/virtual-network-vnet-plan-design-arm.md).
32+
33+
:::image type="content" source="media/networking/azure-container-apps-virtual-network.png" alt-text="Diagram of how Azure Container Apps environments use an existing V NET, or you can provide your own.":::
34+
35+
> [!NOTE]
36+
> Moving VNets among different resource groups or subscriptions isn't allowed if the VNet is in use by a Container Apps environment.
37+
38+
## Subnet
39+
40+
Virtual network integration depends on a dedicated subnet. The allocation of IP addresses in a subnet and the supported subnet sizes depend on the [plan](plans.md) you're using in Azure Container Apps.
41+
42+
Select your subnet size carefully. Subnet sizes can't be modified after you create a Container Apps environment.
43+
44+
Different environment types have different subnet requirements:
45+
46+
# [Workload profiles environment](#tab/workload-profiles-env)
47+
48+
- `/27` is the minimum subnet size required for virtual network integration.
49+
50+
- You must delegate your subnet to `Microsoft.App/environments`.
51+
52+
- When using an external environment with external ingress, inbound traffic routes through the infrastructure’s public IP rather than through your subnet.
53+
54+
- Container Apps automatically reserves 12 IP addresses for integration with the subnet. The number of IP addresses required for infrastructure integration doesn't vary based on the scale demands of the environment. Additional IP addresses are allocated according to the following rules depending on the type of workload profile you're using more IP addresses are allocated depending on your environment's workload profile:
55+
56+
- [Dedicated workload profile](workload-profiles-overview.md#profile-types): As your container app scales out, each node has one IP address assigned.
57+
58+
- [Consumption workload profile](workload-profiles-overview.md#profile-types): Each IP address may be shared among multiple replicas. When planning for how many IP addresses are required for your app, plan for 1 IP address per 10 replicas.
59+
60+
- When you make a [change to a revision](revisions.md#revision-scope-changes) in single revision mode, the required address space is doubled for a short period of time in order to support zero downtime deployments. This affects the real, available supported replicas or nodes for a given subnet size. The following table shows both the maximum available addresses per CIDR block and the effect on horizontal scale.
61+
62+
| Subnet Size | Available IP Addresses<sup>1</sup> | Max nodes (Dedicated workload profile)<sup>2</sup>| Max replicas (Consumption workload profile)<sup>2</sup> |
63+
|--|--|--|--|
64+
| /23 | 498 | 249 | 2,490 |
65+
| /24 | 242 | 121 | 1,210 |
66+
| /25 | 114 | 57 | 570 |
67+
| /26 | 50 | 25 | 250 |
68+
| /27 | 18 | 9 | 90 |
69+
70+
<sup>1</sup> The available IP addresses is the size of the subnet minus the 14 IP addresses required for Azure Container Apps infrastructure which includes 5 IP addresses reserved by the subnet.
71+
<sup>2</sup> This is accounting for apps in single revision mode.
72+
73+
# [Consumption-only environment](#tab/consumption-only-env)
74+
75+
- `/23` is the minimum subnet size required for virtual network integration.
76+
77+
- Your subnet must not be delegated to any services.
78+
79+
- The Container Apps runtime reserves a minimum of 60 IPs for infrastructure in your VNet. The reserved amount may increase up to 256 addresses as apps in your environment scale.
80+
81+
- As your apps scale, a new IP address is allocated for each new replica.
82+
83+
- When you make a [change to a revision](revisions.md#revision-scope-changes) in single revision mode, the required address space is doubled for a short period of time in order to support zero downtime deployments. This affects the real, available supported replicas for a given subnet size.
84+
85+
---
86+
87+
### Subnet address range restrictions
88+
89+
# [Workload profiles environment](#tab/workload-profiles-env)
90+
91+
Subnet address ranges can't overlap with the following ranges reserved by Azure Kubernetes Services:
92+
93+
- 169.254.0.0/16
94+
- 172.30.0.0/16
95+
- 172.31.0.0/16
96+
- 192.0.2.0/24
97+
98+
In addition, a workload profiles environment reserves the following addresses:
99+
100+
- 100.100.0.0/17
101+
- 100.100.128.0/19
102+
- 100.100.160.0/19
103+
- 100.100.192.0/19
104+
105+
# [Consumption-only environment](#tab/consumption-only-env)
106+
107+
Subnet address ranges can't overlap with the following ranges reserved by Azure Kubernetes Services:
108+
109+
- 169.254.0.0/16
110+
- 172.30.0.0/16
111+
- 172.31.0.0/16
112+
- 192.0.2.0/24
113+
114+
If you created your container apps environment with a custom service CIDR, make sure your container app's subnet (or any peered subnet) doesn't conflict with your custom service CIDR range.
115+
116+
---
117+
118+
### Subnet configuration with CLI
119+
120+
As a Container Apps environment is created, you provide resource IDs for a single subnet.
121+
122+
If you're using the CLI, the parameter to define the subnet resource ID is `infrastructure-subnet-resource-id`. The subnet hosts infrastructure components and user app containers.
123+
124+
If you're using the Azure CLI with a Consumption only environment and the [platformReservedCidr](vnet-custom-internal.md#networking-parameters) range is defined, both subnets must not overlap with the IP range defined in `platformReservedCidr`.
125+
126+
## NAT gateway integration
127+
128+
You can use NAT Gateway to simplify outbound connectivity for your outbound internet traffic in your virtual network in a workload profiles environment.
129+
130+
When you configure a NAT Gateway on your subnet, the NAT Gateway provides a static public IP address for your environment. All outbound traffic from your container app is routed through the NAT Gateway's static public IP address.
131+
132+
## Managed resources
133+
134+
When you deploy an internal or an external environment into your own network, a new resource group is created in the Azure subscription where your environment is hosted. This resource group contains infrastructure components managed by the Azure Container Apps platform. Don't modify the services in this group or the resource group itself.
135+
136+
> [!NOTE]
137+
> User-defined tags assigned to your Container Apps environment are replicated to all resources within the resource group, including the resource group itself.
138+
139+
# [Workload profiles environment](#tab/workload-profiles-env)
140+
141+
The name of the resource group created in the Azure subscription where your environment is hosted is prefixed with `ME_` by default, and the resource group name *can* be customized as you create your container app environment.
142+
143+
For external environments, the resource group contains a public IP address used specifically for inbound connectivity to your external environment and a load balancer. For internal environments, the resource group only contains a [Load Balancer](https://azure.microsoft.com/pricing/details/load-balancer/).
144+
145+
In addition to the standard [Azure Container Apps billing](./billing.md), you're billed for:
146+
147+
- One standard static [public IP](https://azure.microsoft.com/pricing/details/ip-addresses/) for egress if using an internal or external environment, plus one standard static [public IP](https://azure.microsoft.com/pricing/details/ip-addresses/) for ingress if using an external environment. If you need more public IPs for egress due to SNAT issues, [open a support ticket to request an override](https://azure.microsoft.com/support/create-ticket/).
148+
149+
- One standard [load balancer](https://azure.microsoft.com/pricing/details/load-balancer/).
150+
151+
- The cost of data processed (in GBs) includes both ingress and egress for management operations.
152+
153+
# [Consumption only environment](#tab/consumption-only-env)
154+
155+
The name of the resource group created in the Azure subscription where your environment is hosted is prefixed with `MC_` by default, and the resource group name *can't* be customized when you create a container app. The resource group contains public IP addresses used specifically for outbound connectivity from your environment and a load balancer.
156+
157+
In addition to the standard [Azure Container Apps billing](./billing.md), you're billed for:
158+
159+
- One standard static [public IP](https://azure.microsoft.com/pricing/details/ip-addresses/) for egress. If you need more IPs for egress due to Source Network Address Translation (SNAT) issues, [open a support ticket to request an override](https://azure.microsoft.com/support/create-ticket/).
160+
161+
- Two standard [load balancers](https://azure.microsoft.com/pricing/details/load-balancer/) if using an internal environment, or one standard [load balancer](https://azure.microsoft.com/pricing/details/load-balancer/) if using an external environment. Each load balancer has fewer than six rules. The cost of data processed (in GBs) includes both ingress and egress for management operations.
162+
163+
---
164+
165+
## Next steps
166+
167+
> [!div class="nextstepaction"]
168+
> [Managing outbound connections with Azure Firewall](use-azure-firewall.md)

articles/container-apps/firewall-integration.md

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,26 @@
11
---
2-
title: Securing a custom VNET in Azure Container Apps
3-
description: Firewall settings to secure a custom VNET in Azure Container Apps
2+
title: Securing a virtual network in Azure Container Apps
3+
description: Firewall settings to secure a virtual network in Azure Container Apps
44
services: container-apps
5-
author: CaryChai
5+
author: craigshoemaker
66
ms.service: azure-container-apps
7-
ms.topic: reference
8-
ms.date: 01/09/2025
9-
ms.author: cachai
7+
ms.topic: reference
8+
ms.date: 04/08/2025
9+
ms.author: cshoe
1010
---
1111

12-
# Securing a custom VNET in Azure Container Apps with Network Security Groups
12+
# Securing a virtual network in Azure Container Apps with Network Security Groups
1313

1414
Network Security Groups (NSGs) needed to configure virtual networks closely resemble the settings required by Kubernetes.
1515

1616
You can lock down a network via NSGs with more restrictive rules than the default NSG rules to control all inbound and outbound traffic for the Container Apps environment at the subscription level.
1717

18-
In the workload profiles environment, user-defined routes (UDRs) and [securing outbound traffic with a firewall](./networking.md#configuring-udr-with-azure-firewall) are supported. When using an external workload profiles environment, inbound traffic to Azure Container Apps is routed through the public IP that exists in the [managed resource group](./networking.md#workload-profiles-environment-2) rather than through your subnet. This means that locking down inbound traffic via NSG or Firewall on an external workload profiles environment isn't supported. For more information, see [Networking in Azure Container Apps environments](./networking.md#user-defined-routes-udr).
18+
In the workload profiles environment, user-defined routes (UDRs) and [securing outbound traffic with a firewall](./use-azure-firewall.md) are supported.
19+
20+
> [!NOTE]
21+
> For a guide on how to set up UDR with Container Apps to restrict outbound traffic with Azure Firewall, visit the how to for [Container Apps and Azure Firewall](user-defined-routes.md).
22+
23+
When using an external workload profiles environment, inbound traffic to Azure Container Apps is routed through the public IP that exists in the [managed resource group](./networking.md#ports-and-ip-addresses) rather than through your subnet. This means that locking down inbound traffic via NSG or Firewall on an external workload profiles environment isn't supported. For more information, see [Control outbound traffic with user defined routes](./user-defined-routes.md).
1924

2025
In the Consumption only environment, express routes aren't supported, and custom user-defined routes (UDRs) have limited support. For more information on the level of UDR support available in a Consumption-only environment, see the [FAQ](faq.yml#do-consumption-only-environments-support-custom-user-defined-routes-).
2126

@@ -51,7 +56,6 @@ The following tables describe how to configure a collection of NSG allow rules.
5156
<sup>1</sup> This address is passed as a parameter when you create an environment. For example, `10.0.0.0/21`.
5257
<sup>2</sup> The full range is required when creating your Azure Container Apps as a port within the range will by dynamically allocated. Once created, the required ports are two immutable, static values, and you can update your NSG rules.
5358

54-
5559
### Outbound
5660

5761
# [Workload profiles environment](#tab/workload-profiles)
@@ -87,14 +91,16 @@ The following tables describe how to configure a collection of NSG allow rules.
8791
| TCP | Your container app's subnet | \* | `Storage.<Region>` | `443` | Only required when using `Azure Container Registry` to host your images. |
8892
| TCP | Your container app's subnet | \* | `AzureMonitor` | `443` | Only required when using Azure Monitor. Allows outbound calls to Azure Monitor. |
8993

90-
9194
---
9295

9396
<sup>1</sup> This address is passed as a parameter when you create an environment. For example, `10.0.0.0/21`.
9497
<sup>2</sup> If you're using Azure Container Registry (ACR) with NSGs configured on your virtual network, create a private endpoint on your ACR to allow Azure Container Apps to pull images through the virtual network. You don't need to add an NSG rule for ACR when configured with private endpoints.
9598

96-
9799
#### Considerations
98100

99101
- If you're running HTTP servers, you might need to add ports `80` and `443`.
100102
- Don't explicitly deny the Azure DNS address `168.63.129.16` in the outgoing NSG rules, or your Container Apps environment doesn't function.
103+
104+
## Next steps
105+
106+
- [Use a private endpoint](how-to-use-private-endpoint.md)

0 commit comments

Comments
 (0)