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
## <aname="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.
0 commit comments