@@ -5,7 +5,7 @@ services: private-link
5
5
author : asudbring
6
6
ms.service : private-link
7
7
ms.topic : quickstart
8
- ms.date : 01/24/2021
8
+ ms.date : 02/02/2023
9
9
ms.author : allensu
10
10
ms.custom : devx-track-azurepowershell, mode-api
11
11
# 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,30 @@ New-AzLoadBalancer @loadbalancer
130
130
131
131
```
132
132
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-interactive
140
+ ## Place the subnet name into a variable. ##
141
+ $subnet = 'mySubnet'
142
+
143
+ ## Place the virtual network configuration into a variable. ##
144
+ $net = @{
145
+ Name = 'myVNet'
146
+ ResourceGroupName = 'CreatePrivLinkService-rg'
147
+ }
148
+ $vnet = Get-AzVirtualNetwork @net
149
+
150
+ ## Set the policy as disabled on the virtual network. ##
151
+ ($vnet | Select -ExpandProperty subnets | Where-Object {$_.Name -eq $subnet}).privateLinkServiceNetworkPolicies = "Disabled"
152
+
153
+ ## Save the configuration changes to the virtual network. ##
154
+ $vnet | Set-AzVirtualNetwork
155
+ ```
156
+
133
157
## Create a private link service
134
158
135
159
In this section, create a private link service that uses the Standard Azure Load Balancer created in the previous step.
@@ -138,7 +162,7 @@ In this section, create a private link service that uses the Standard Azure Load
138
162
139
163
* Create the private link service with [ New-AzPrivateLinkService] ( /powershell/module/az.network/new-azprivatelinkservice ) .
140
164
141
- ``` azurepowershell
165
+ ``` azurepowershell-interactive
142
166
## Place the virtual network into a variable. ##
143
167
$vnet = Get-AzVirtualNetwork -Name 'myVNet' -ResourceGroupName 'CreatePrivLinkService-rg'
144
168
@@ -207,8 +231,6 @@ $vnetpe = New-AzVirtualNetwork @net
207
231
208
232
* Use [ New-AzPrivateEndpoint] ( /powershell/module/az.network/new-azprivateendpoint ) to create the endpoint.
209
233
210
-
211
-
212
234
``` azurepowershell-interactive
213
235
## Place the private link service configuration into variable. ##
214
236
$par1 = @{
0 commit comments