Skip to content

Commit 40c90ac

Browse files
committed
added disable network policy to fix errors
1 parent a48a306 commit 40c90ac

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

articles/private-link/create-private-link-service-powershell.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ services: private-link
55
author: asudbring
66
ms.service: private-link
77
ms.topic: quickstart
8-
ms.date: 01/24/2021
8+
ms.date: 02/02/2023
99
ms.author: allensu
1010
ms.custom: devx-track-azurepowershell, mode-api
1111
#Customer intent: As someone with a basic network background, but is new to Azure, I want to create an Azure private link service
@@ -130,6 +130,26 @@ New-AzLoadBalancer @loadbalancer
130130
131131
```
132132

133+
## Disable network policy
134+
135+
Before a private link service can be created in the virtual network, the setting `privateLinkServiceNetworkPolicies` must be disabled.
136+
137+
* Disable the network policy with [Set-AzVirtualNetwork](/powershell/module/az.network/Set-AzVirtualNetwork).
138+
139+
```azurepowershell
140+
$subnet = 'mySubnet'
141+
142+
$net = @{
143+
Name = 'myVNet'
144+
ResourceGroupName = 'myResourceGroup'
145+
}
146+
$vnet = Get-AzVirtualNetwork @net
147+
148+
($vnet | Select -ExpandProperty subnets | Where-Object {$_.Name -eq $subnet}).privateLinkServiceNetworkPolicies = "Disabled"
149+
150+
$vnet | Set-AzVirtualNetwork
151+
```
152+
133153
## Create a private link service
134154

135155
In this section, create a private link service that uses the Standard Azure Load Balancer created in the previous step.

0 commit comments

Comments
 (0)