Skip to content

Commit 22b85bc

Browse files
Merge pull request #314103 from craigshoemaker/aca/128121
[Container Apps] Update: Add outbound rule for consumption environment and improve documentation
2 parents 536eba6 + 361fbc8 commit 22b85bc

1 file changed

Lines changed: 24 additions & 23 deletions

File tree

articles/container-apps/firewall-integration.md

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ services: container-apps
55
author: craigshoemaker
66
ms.service: azure-container-apps
77
ms.topic: reference
8-
ms.date: 04/08/2025
8+
ms.date: 04/01/2026
99
ms.author: cshoe
1010
---
1111

1212
# Securing a virtual network in Azure Container Apps with Network Security Groups
1313

14-
Network Security Groups (NSGs) needed to configure virtual networks closely resemble the settings required by Kubernetes.
14+
Network Security Groups (NSGs) that you need 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

@@ -20,7 +20,7 @@ In the workload profiles environment, user-defined routes (UDRs) and [securing o
2020
> [!NOTE]
2121
> 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).
2222
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).
23+
When you use an external workload profiles environment, inbound traffic to Azure Container Apps routes through the public IP that exists in the [managed resource group](./networking.md#ports-and-ip-addresses) rather than through your subnet. This limitation 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).
2424

2525
In the legacy 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-).
2626

@@ -32,68 +32,69 @@ The following tables describe how to configure a collection of NSG allow rules.
3232

3333
# [Workload profiles environment](#tab/workload-profiles)
3434

35-
>[!Note]
36-
> When using workload profiles, inbound NSG rules only apply for traffic going through your virtual network. If your container apps are set to accept traffic from the public internet, incoming traffic goes through the public endpoint instead of the virtual network.
35+
>[!NOTE]
36+
> When you use workload profiles, inbound NSG rules only apply to traffic that goes through your virtual network. If you set your container apps to accept traffic from the public internet, incoming traffic goes through the public endpoint instead of the virtual network.
3737
3838
| Protocol | Source | Source ports | Destination | Destination ports | Description |
3939
|--|--|--|--|--|--|
40-
| TCP | Your client IPs | \* | Your container app's subnet<sup>1</sup> | `80`, `31080` | Allow your Client IPs to access Azure Container Apps when using HTTP. `31080` is the port on which the Container Apps Environment Edge Proxy responds to the HTTP traffic. It is behind the internal load balancer. |
41-
| TCP | Your client IPs | \* | Your container app's subnet<sup>1</sup> | `443`, `31443` | Allow your Client IPs to access Azure Container Apps when using HTTPS. `31443` is the port on which the Container Apps Environment Edge Proxy responds to the HTTPS traffic. It is behind the internal load balancer. |
40+
| TCP | Your client IPs | \* | Your container app's subnet<sup>1</sup> | `80`, `31080` | Allow your client IPs to access Azure Container Apps when using HTTP. `31080` is the port on which the Container Apps Environment Edge Proxy responds to the HTTP traffic. It's behind the internal load balancer. |
41+
| TCP | Your client IPs | \* | Your container app's subnet<sup>1</sup> | `443`, `31443` | Allow your client IPs to access Azure Container Apps when using HTTPS. `31443` is the port on which the Container Apps Environment Edge Proxy responds to the HTTPS traffic. It's behind the internal load balancer. |
4242
| TCP | AzureLoadBalancer | \* | Your container app's subnet | `30000-32767`<sup>2</sup> | Allow Azure Load Balancer to probe backend pools. |
43-
| TCP | Your client IPs | \* | Your container app's subnet | Exposed ports and `30000-32767`<sup>2</sup> | This only applies for TCP apps. This is not required for HTTP apps. |
43+
| TCP | Your client IPs | \* | Your container app's subnet | Exposed ports and `30000-32767`<sup>2</sup> | This rule only applies to TCP apps. This rule isn't required for HTTP apps. |
4444

4545
# [Consumption only environment](#tab/consumption-only)
4646

4747
| Protocol | Source | Source ports | Destination | Destination ports | Description |
4848
|--|--|--|--|--|--|
49-
| TCP | Your client IPs | \* | Your container app's subnet<sup>1</sup> | `80`, `443` | Allow your Client IPs to access Azure Container Apps. Use port `80` for HTTP and `443` for HTTPS. |
50-
| TCP | Your client IPs | \* | The `staticIP` of your container app environment | `80`, `443` | Allow your Client IPs to access Azure Container Apps. Use port `80` for HTTP and `443` for HTTPS. |
49+
| TCP | Your client IPs | \* | Your container app's subnet<sup>1</sup> | `80`, `443` | Allow your client IPs to access Azure Container Apps. Use port `80` for HTTP and `443` for HTTPS. |
50+
| TCP | Your client IPs | \* | The `staticIP` of your container app environment | `80`, `443` | Allow your client IPs to access Azure Container Apps. Use port `80` for HTTP and `443` for HTTPS. |
5151
| TCP | AzureLoadBalancer | \* | Your container app's subnet | `30000-32767`<sup>2</sup> | Allow Azure Load Balancer to probe backend pools. |
5252
| TCP | Your container app's subnet | \* | Your container app's subnet | \* | Required to allow the container app envoy sidecar to connect to envoy service. |
5353

5454
---
5555

56-
<sup>1</sup> This address is passed as a parameter when you create an environment. For example, `10.0.0.0/21`.
57-
<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.
56+
<sup>1</sup> You pass this address as a parameter when you create an environment. For example, `10.0.0.0/21`.
57+
<sup>2</sup> You need the full range when creating your Azure Container Apps as a port within the range is dynamically allocated. Once created, the required ports are two immutable, static values, and you can update your NSG rules.
5858

5959
### Outbound
6060

6161
# [Workload profiles environment](#tab/workload-profiles)
6262

6363
| Protocol | Source | Source ports | Destination | Destination ports | Description |
6464
|--|--|--|--|--|--|
65-
| TCP | Your container app's subnet | \* | `MicrosoftContainerRegistry` | `443` | This is the service tag for Microsoft container registry for system containers. |
66-
| TCP | Your container app's subnet | \* | `AzureFrontDoor.FirstParty` | `443` | This is a dependency of the `MicrosoftContainerRegistry` service tag. |
67-
| Any | Your container app's subnet | \* | Your container app's subnet | \* | Allow communication between IPs in your container app's subnet. |
65+
| TCP | Your container app's subnet | \* | `MicrosoftContainerRegistry` | `443` | This service tag represents Microsoft container registry for system containers. |
66+
| TCP | Your container app's subnet | \* | `AzureFrontDoor.FirstParty` | `443` | This service tag is a dependency of the `MicrosoftContainerRegistry` service tag. |
67+
| Any | Your container app's subnet | \* | Your container app's subnet | \* | Allows communication between IPs in your container app's subnet. |
6868
| TCP | Your container app's subnet | \* | `AzureActiveDirectory` | `443` | If you're using a managed identity, it's required. |
6969
| TCP | Your container app's subnet | \* | `AzureMonitor` | `443` | Only required when using Azure Monitor. Allows outbound calls to Azure Monitor. |
7070
| TCP and UDP | Your container app's subnet | \* | `168.63.129.16` | `53` | Enables the environment to use Azure DNS to resolve the hostname. <br><br>**Note**: DNS communication to Azure DNS isn't subject to NSGs unless targeted using the `AzurePlatformDNS` service tag. To block DNS traffic, create an outbound rule to deny traffic to the `AzurePlatformDNS` service tag. |
71-
| TCP | Your container app's subnet<sup>1</sup> | \* | Your Container Registry | Your container registry's port | This is required to communicate with your container registry. For example, when using ACR, you need `AzureContainerRegistry` and `AzureActiveDirectory` for the destination, and the port is your container registry's port unless using private endpoints.<sup>2</sup> |
71+
| TCP | Your container app's subnet<sup>1</sup> | \* | Your Container Registry | Your container registry's port | This rule is required to communicate with your container registry. For example, when using ACR, you need `AzureContainerRegistry` and `AzureActiveDirectory` for the destination, and the port is your container registry's port unless using private endpoints.<sup>2</sup> |
7272
| TCP | Your container app's subnet | \* | `Storage.<Region>` | `443` | Only required when using `Azure Container Registry` to host your images. |
7373

7474

7575
# [Consumption only environment](#tab/consumption-only)
7676

77-
>[!Note]
78-
> When using Consumption only environments, all [outbound ports required by Azure Kubernetes Service](/azure/aks/outbound-rules-control-egress#required-outbound-network-rules-and-fqdns-for-aks-clusters) are also required for your container app.
77+
>[!NOTE]
78+
> When you use Consumption only environments, your container app also needs all [outbound ports required by Azure Kubernetes Service](/azure/aks/outbound-rules-control-egress#required-outbound-network-rules-and-fqdns-for-aks-clusters).
7979
8080
| Protocol | Source | Source ports | Destination | Destination ports | Description |
8181
|--|--|--|--|--|--|
82-
| TCP | Your container app's subnet | \* | `MicrosoftContainerRegistry` | `443` | This is the service tag for Microsoft container registry for system containers. |
83-
| TCP | Your container app's subnet | \* | `AzureFrontDoor.FirstParty` | `443` | This is a dependency of the `MicrosoftContainerRegistry` service tag. |
82+
| TCP | Your container app's subnet | \* | `MicrosoftContainerRegistry` | `443` | This service tag represents Microsoft container registry for system containers. |
83+
| TCP | Your container app's subnet | \* | `AzureFrontDoor.FirstParty` | `443` | This service tag is a dependency of the `MicrosoftContainerRegistry` service tag. |
8484
| UDP | Your container app's subnet | \* | `AzureCloud.<REGION>` | `1194` | Required for internal AKS secure connection between underlying nodes and control plane. Replace `<REGION>` with the region where your container app is deployed. |
8585
| TCP | Your container app's subnet | \* | `AzureCloud.<REGION>` | `9000` | Required for internal AKS secure connection between underlying nodes and control plane. Replace `<REGION>` with the region where your container app is deployed. |
8686
| TCP | Your container app's subnet | \* | `AzureCloud` | `443` | Allowing all outbound on port `443` provides a way to allow all FQDN based outbound dependencies that don't have a static IP. |
87+
| TCP | Your container app's subnet | \* | `EventHub.<REGION>` | `5671`, `5672` | Required for internal diagnostics logging in consumption-only environments. Replace `<REGION>` with the region where your container app is deployed |
8788
| UDP | Your container app's subnet | \* | \* | `123` | NTP server. |
88-
| Any | Your container app's subnet | \* | Your container app's subnet | \* | Allow communication between IPs in your container app's subnet. |
89+
| Any | Your container app's subnet | \* | Your container app's subnet | \* | Allows communication between IPs in your container app's subnet. |
8990
| TCP and UDP | Your container app's subnet | \* | `168.63.129.16` | `53` | Enables the environment to use Azure DNS to resolve the hostname. <br><br>**Note**: DNS communication to Azure DNS isn't subject to NSGs unless targeted using the `AzurePlatformDNS` service tag. To block DNS traffic, create an outbound rule to deny traffic to the `AzurePlatformDNS` service tag.|
90-
| TCP | Your container app's subnet<sup>1</sup> | \* | Your Container Registry | Your container registry's port | This is required to communicate with your container registry. For example, when using ACR, you need `AzureContainerRegistry` and `AzureActiveDirectory` for the destination, and the port is your container registry's port unless using private endpoints.<sup>2</sup> |
91+
| TCP | Your container app's subnet<sup>1</sup> | \* | Your Container Registry | Your container registry's port | This rule is required to communicate with your container registry. For example, when using ACR, you need `AzureContainerRegistry` and `AzureActiveDirectory` for the destination, and the port is your container registry's port unless using private endpoints.<sup>2</sup> |
9192
| TCP | Your container app's subnet | \* | `Storage.<Region>` | `443` | Only required when using `Azure Container Registry` to host your images. |
9293
| TCP | Your container app's subnet | \* | `AzureMonitor` | `443` | Only required when using Azure Monitor. Allows outbound calls to Azure Monitor. |
9394

9495
---
9596

96-
<sup>1</sup> This address is passed as a parameter when you create an environment. For example, `10.0.0.0/21`.
97+
<sup>1</sup> You pass this address as a parameter when you create an environment. For example, `10.0.0.0/21`.
9798
<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.
9899

99100
#### Considerations

0 commit comments

Comments
 (0)