Skip to content

Commit b302029

Browse files
committed
fixes
1 parent 6430c6b commit b302029

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

articles/virtual-network/virtual-network-service-endpoint-policies.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -119,16 +119,18 @@ $vnet = @{
119119
$virtualNetwork = New-AzVirtualNetwork @vnet
120120
```
121121

122-
Create a subnet in the virtual network. In this example, a subnet named *subnet-1* is created with a service endpoint for *Microsoft.Storage*:
122+
Create a subnet configuration with [New-AzVirtualNetworkSubnetConfig](/powershell/module/az.network/new-azvirtualnetworksubnetconfig), and then write the subnet configuration to the virtual network with [Set-AzVirtualNetwork](/powershell/module/az.network/set-azvirtualnetwork). The following example adds a subnet named _subnet-1_ to the virtual network and creates the service endpoint for *Microsoft.Storage*.
123123

124124
```azurepowershell-interactive
125-
$subnetpriv = @{
125+
$subnet = @{
126126
Name = "subnet-1"
127-
AddressPrefix = "10.0.0.0/24"
128127
VirtualNetwork = $virtualNetwork
128+
AddressPrefix = "10.0.0.0/24"
129129
ServiceEndpoint = "Microsoft.Storage"
130130
}
131-
$virtualNetwork | Set-AzVirtualNetwork @subnetpriv
131+
Add-AzVirtualNetworkSubnetConfig @subnet
132+
133+
$virtualNetwork | Set-AzVirtualNetwork
132134
```
133135

134136
### [CLI](#tab/cli)
@@ -529,7 +531,7 @@ $storageAcctParams2 = @{
529531
ResourceGroupName = "test-rg"
530532
AccountName = $storageAcctName2
531533
}
532-
$storageAcctKey2 = (Get-AzStorageAccountKey @storageAcctParams1).Value[0]
534+
$storageAcctKey2 = (Get-AzStorageAccountKey @storageAcctParams2).Value[0]
533535
```
534536

535537
Create a context for your storage account and key with [New-AzStorageContext](/powershell/module/az.storage/new-AzStoragecontext). The context encapsulates the storage account name and account key.
@@ -780,7 +782,7 @@ Use [New-AzServiceEndpointPolicy](/powershell/module/az.network/new-azserviceend
780782
```azurepowershell-interactive
781783
$sepolicyParams = @{
782784
ResourceGroupName = "test-rg"
783-
Name = "sepolicy"
785+
Name = "service-endpoint-policy"
784786
Location = "westus2"
785787
ServiceEndpointPolicyDefinition = $policyDefinition
786788
}
@@ -802,7 +804,7 @@ Create a service endpoint policy
802804
```azurecli-interactive
803805
az network service-endpoint policy create \
804806
--resource-group test-rg \
805-
--name sepolicy \
807+
--name service-endpoint-policy \
806808
--location eastus
807809
```
808810

@@ -811,7 +813,7 @@ Create and add a policy definition for allowing the previous Azure Storage accou
811813
```azurecli-interactive
812814
az network service-endpoint policy-definition create \
813815
--resource-group test-rg \
814-
--policy-name sepolicy \
816+
--policy-name service-endpoint-policy \
815817
--name policy-definition \
816818
--service "Microsoft.Storage" \
817819
--service-resources $serviceResourceId
@@ -865,7 +867,7 @@ az network vnet subnet update \
865867
--resource-group test-rg \
866868
--name subnet-1 \
867869
--service-endpoints Microsoft.Storage \
868-
--service-endpoint-policy sepolicy
870+
--service-endpoint-policy service-endpoint-policy
869871
```
870872

871873
---
@@ -925,7 +927,7 @@ To test network access to a storage account, deploy a VM in the subnet.
925927

926928
### [PowerShell](#tab/powershell)
927929

928-
Create a virtual machine in the *subnet-1* subnet with [New-AzVM](/powershell/module/az.compute/new-azvm). When running the command that follows, you're prompted for credentials. The values that you enter are configured as the user name and password for the VM. The `-AsJob` option creates the VM in the background, so that you can continue to the next step.
930+
Create a virtual machine in the *subnet-1* subnet with [New-AzVM](/powershell/module/az.compute/new-azvm). When running the command that follows, you're prompted for credentials. The values that you enter are configured as the user name and password for the VM.
929931

930932
```azurepowershell-interactive
931933
$vmParams = @{

0 commit comments

Comments
 (0)