Skip to content

Commit 6c81d05

Browse files
authored
Merge pull request #219703 from anthonychu/patch-15
[Container Apps] Add IP restrictions
2 parents 3371827 + 1c60aa9 commit 6c81d05

File tree

1 file changed

+57
-2
lines changed

1 file changed

+57
-2
lines changed

articles/container-apps/ingress.md

Lines changed: 57 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ services: container-apps
55
author: craigshoemaker
66
ms.service: container-apps
77
ms.topic: how-to
8-
ms.date: 09/29/2022
8+
ms.date: 11/28/2022
99
ms.author: cshoe
1010
ms.custom: ignite-fall-2021, event-tier1-build-2022
1111
---
@@ -77,7 +77,7 @@ The following settings are available when configuring ingress:
7777
> [!NOTE]
7878
> To disable ingress for your application, omit the `ingress` configuration property entirely.
7979
80-
## IP addresses and domain names
80+
## Fully qualified domain name
8181

8282
With ingress enabled, your application is assigned a fully qualified domain name (FQDN). The domain name takes the following forms:
8383

@@ -98,6 +98,61 @@ You can get access to the environment's unique identifier by querying the enviro
9898

9999
[!INCLUDE [container-apps-get-fully-qualified-domain-name](../../includes/container-apps-get-fully-qualified-domain-name.md)]
100100

101+
## <a name="ip-access-restrictions"></a>Inbound access restrictions by IP address ranges (preview)
102+
103+
By default, ingress doesn't filter traffic. You can add restrictions to limit access based on IP addresses. There are two ways to filter traffic:
104+
105+
* **Allowlist**: Deny all inbound traffic, but allow access from a list of IP address ranges
106+
* **Denylist**: Allow all inbound traffic, but deny access from a list of IP address ranges
107+
108+
> [!NOTE]
109+
> If defined, all rules must be the same type. You cannot combine allow rules and deny rules.
110+
>
111+
> IPv4 addresses are supported. Define each IPv4 address block in Classless Inter-Domain Routing (CIDR) notation. To learn more about CIDR notation, see [Classless Inter-Domain Routing](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing).
112+
113+
### Configure an allowlist
114+
115+
To allow inbound traffic from a specified IP range, run the following Azure CLI command.
116+
117+
```azurecli
118+
az containerapp ingress access-restriction set \
119+
--name MyContainerapp \
120+
--resource-group MyResourceGroup \
121+
--rule-name restrictionName \
122+
--ip-address 192.168.1.1/28 \
123+
--description "Restriction description." \
124+
--action Allow
125+
```
126+
127+
Add more allow rules by repeating the command with a different IP address range in the `--ip-address` parameter. When you configure one or more allow rules, only traffic that matches at least one rule is allowed. All other traffic is denied.
128+
129+
### Configure a denylist
130+
131+
To deny inbound traffic from a specified IP range, run the following Azure CLI command.
132+
133+
```azurecli
134+
az containerapp ingress access-restriction set \
135+
--name MyContainerapp \
136+
--resource-group MyResourceGroup \
137+
--rule-name my-restriction \
138+
--ip-address 192.168.1.1/28 \
139+
--description "Restriction description."
140+
--action Deny
141+
```
142+
143+
Add more deny rules by repeating the command with a different IP address range in the `--ip-address` parameter. When you configure one or more deny rules, any traffic that matches at least one rule is denied. All other traffic is allowed.
144+
145+
### Remove access restrictions
146+
147+
To remove an access restriction, run the following Azure CLI command.
148+
149+
```azurecli
150+
az containerapp ingress access-restriction remove
151+
--name MyContainerapp \
152+
--resource-group MyResourceGroup \
153+
--rule-name my-restriction
154+
```
155+
101156
## Next steps
102157

103158
> [!div class="nextstepaction"]

0 commit comments

Comments
 (0)