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
Copy file name to clipboardExpand all lines: articles/private-link/disable-private-endpoint-network-policy.md
+9-8Lines changed: 9 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,16 +14,17 @@ ms.devlang: azurecli
14
14
---
15
15
# Manage network policies for private endpoints
16
16
17
-
By default, network policies are disabled for a subnet in a virtual network. To utilize network policies like UDR and NSG support, network policy support must be enabled for the subnet. This setting is only applicable to private endpoints within the subnet. This setting affects all private endpoints within the subnet. For other resources in the subnet, access is controlled based on security rules in the network security group.
17
+
By default, network policies are disabled for a subnet in a virtual network. To utilize network policies like User-Defined Routes and Network Security Groups support, network policy support must be enabled for the subnet. This setting is only applicable to private endpoints within the subnet. This setting affects all private endpoints within the subnet. For other resources in the subnet, access is controlled based on security rules in the network security group.
18
+
19
+
Network policies can be enabled either for Network Security Groups only, for User-Defined Routes only, or for both.
20
+
21
+
If you enable network security policies for User-Defined Routes, the /32 routes that are generated by the private endpoint and propagated to all the subnets in its own VNet and directly peered VNets will be invalidated if you have User-Defined Routing, which is useful if you want all traffic (including traffic addressed to the private endpoint) to go through a firewall, since otherwise the /32 route would bypass any other route.
18
22
19
23
You can use the following to enable or disable the setting:
20
24
21
25
* Azure portal
22
-
23
26
* Azure PowerShell
24
-
25
27
* Azure CLI
26
-
27
28
* Azure Resource Manager templates
28
29
29
30
The following examples describe how to enable and disable `PrivateEndpointNetworkPolicies` for a virtual network named **myVNet** with a **default** subnet of **10.1.0.0/24** hosted in a resource group named **myResourceGroup**.
@@ -42,7 +43,7 @@ The following examples describe how to enable and disable `PrivateEndpointNetwor
42
43
43
44
5. Select the **default** subnet.
44
45
45
-
6. In the properties for the **default** subnet, select **Enabled** in **NETWORK POLICY FOR PRIVATE ENDPOINTS**.
46
+
6. In the properties for the **default** subnet, enable the checkboxes for "Network Security Groups", "Route tables" or both in **NETWORK POLICY FOR PRIVATE ENDPOINTS**.
46
47
47
48
7. Select **Save**.
48
49
@@ -61,7 +62,7 @@ $sub = @{
61
62
Name = 'default'
62
63
VirtualNetwork = $vnet
63
64
AddressPrefix = '10.1.0.0/24'
64
-
PrivateEndpointNetworkPoliciesFlag = 'Enabled'
65
+
PrivateEndpointNetworkPoliciesFlag = 'Enabled' # Can be either 'Disabled', 'NetworkSecurityGroupEnabled', 'RouteTableEnabled', or 'Enabled'
65
66
}
66
67
Set-AzVirtualNetworkSubnetConfig @sub
67
68
@@ -70,7 +71,7 @@ $vnet | Set-AzVirtualNetwork
70
71
71
72
# [**CLI**](#tab/network-policy-cli)
72
73
73
-
Use [az network vnet subnet update](/cli/azure/network/vnet/subnet#az-network-vnet-subnet-update) to enable the policy.
74
+
Use [az network vnet subnet update](/cli/azure/network/vnet/subnet#az-network-vnet-subnet-update) to enable the policy. The Azure CLI only supports the values `true` or `false`, it does not allow yet to enable the policies selectively only for User-Defined Routes or Network Security Groups:
74
75
75
76
```azurecli
76
77
az network vnet subnet update \
@@ -82,7 +83,7 @@ az network vnet subnet update \
82
83
83
84
# [**JSON**](#tab/network-policy-json)
84
85
85
-
This section describes how to enable subnet private endpoint policies using an Azure Resource Manager template.
86
+
This section describes how to enable subnet private endpoint policies using an Azure Resource Manager template. The possible values for the `privateEndpointNetworkPolicies` are `Disabled`, `NetworkSecurityGroupEnabled`, `RouteTableEnabled`, and `Enabled`.
0 commit comments