Skip to content

Commit 5ac0d7a

Browse files
authored
Merge pull request #312920 from MicrosoftDocs/repo_sync_working_branch
Confirm merge from repo_sync_working_branch to main to sync with https://github.com/MicrosoftDocs/azure-docs (branch main)
2 parents bbd030a + f443fa9 commit 5ac0d7a

1 file changed

Lines changed: 67 additions & 12 deletions

File tree

articles/application-gateway/private-link-configure.md

Lines changed: 67 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,73 @@ To create a dedicated subnet for Private Link, see [Add, change, or delete a vir
5959

6060
## Disable network policies on the Private Link subnet
6161

62-
To allow Private Link connectivity, you must [disable the Private Link Service Network Policies](../private-link/disable-private-endpoint-network-policy.md#disable-network-policy) on the subnet designated for Private Link IP configurations.
63-
64-
To disable network policies, follow these steps:
65-
1. Navigate to the [Azure portal](https://portal.azure.com).
66-
1. Search for and select **Virtual networks**.
67-
1. Select the virtual network containing the Private Link subnet.
68-
1. In the left navigation pane, select **Subnets**.
69-
1. Select the subnet designated for Private Link.
70-
1. Under **Private link service network policies**, select **Disabled**.
71-
1. Select **Save** to apply the changes.
72-
1. Wait a few minutes for the changes to take effect.
73-
1. Verify the **Private link service network policies** setting is now **Disabled**.
62+
To allow Private Link connectivity, you must [disable the Private Link Service Network Policies](../private-link/disable-private-link-service-network-policy.md) on the subnet designated for Private Link IP configurations.
63+
64+
When you use the portal to create an instance of the Private Link service, this setting is automatically disabled as part of the creation process. Deployments using any Azure client (PowerShell, Azure CLI, or templates) require an extra step to change this property.
65+
66+
The following examples describe how to enable and disable `privateLinkServiceNetworkPolicies` for a virtual network named `myVNet` with a `default` subnet of `10.1.0.0/24` hosted in a resource group named `myResourceGroup`.
67+
68+
# [**PowerShell**](#tab/private-link-network-policy-powershell)
69+
70+
This section describes how to disable subnet private endpoint policies by using Azure PowerShell. In the following code, replace `default` with the name of your virtual subnet.
71+
72+
```azurepowershell
73+
$subnet = 'default'
74+
75+
$net = @{
76+
Name = 'myVNet'
77+
ResourceGroupName = 'myResourceGroup'
78+
}
79+
$vnet = Get-AzVirtualNetwork @net
80+
81+
($vnet | Select -ExpandProperty subnets | Where-Object {$_.Name -eq $subnet}).privateLinkServiceNetworkPolicies = "Disabled"
82+
83+
$vnet | Set-AzVirtualNetwork
84+
```
85+
86+
# [**CLI**](#tab/private-link-network-policy-cli)
87+
88+
This section describes how to disable subnet private endpoint policies by using the Azure CLI.
89+
90+
```azurecli
91+
az network vnet subnet update \
92+
--name default \
93+
--vnet-name myVNet \
94+
--resource-group myResourceGroup \
95+
--disable-private-link-service-network-policies yes
96+
```
97+
98+
# [**JSON**](#tab/private-link-network-policy-json)
99+
100+
This section describes how to disable subnet private endpoint policies by using Azure Resource Manager templates.
101+
102+
```json
103+
{
104+
"name": "myVNet",
105+
"type": "Microsoft.Network/virtualNetworks",
106+
"apiVersion": "2019-04-01",
107+
"location": "WestUS",
108+
"properties": {
109+
"addressSpace": {
110+
"addressPrefixes": [
111+
"10.1.0.0/16"
112+
]
113+
},
114+
"subnets": [
115+
{
116+
"name": "default",
117+
"properties": {
118+
"addressPrefix": "10.1.0.0/24",
119+
"privateLinkServiceNetworkPolicies": "Disabled"
120+
}
121+
}
122+
]
123+
}
124+
}
125+
126+
```
127+
128+
---
74129

75130
## Configure Private Link
76131

0 commit comments

Comments
 (0)