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/virtual-network/virtual-network-service-endpoint-policies.md
+27-28Lines changed: 27 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,11 +24,11 @@ Service endpoint policies enable you to filter virtual network traffic to specif
24
24
> [!div class="checklist"]
25
25
* Create a virtual network.
26
26
* Add a subnet and enable service endpoint for Azure Storage.
27
-
* Create two Azure Storage accounts and allow network access to it from the subnet created above.
27
+
* Create two Azure Storage accounts and allow network access to it from the subnet in the virtual network.
28
28
* Create a service endpoint policy to allow access only to one of the storage accounts.
29
29
* Deploy a virtual machine (VM) to the subnet.
30
30
* Confirm access to the allowed storage account from the subnet.
31
-
* Confirm access is denied to the non-allowed storage account from the subnet.
31
+
* Confirm access is denied to the nonallowed storage account from the subnet.
32
32
33
33
## Prerequisites
34
34
@@ -70,7 +70,7 @@ Create a virtual network to contain the resources you create in this tutorial.
70
70
| -------| ------- |
71
71
|**Project details**||
72
72
| Subscription | Select your subscription. |
73
-
| Resource group | Select **Create new**.</br> Enter **test-rg** in **Name**.</br> Select **OK**. |
73
+
| Resource group | Select **Create new**.</br> Enter **test-rg** in **Name**.</br> Select **OK**. |
74
74
| Name | Enter **vnet-1**. |
75
75
| Region | Select **West US 2**. |
76
76
@@ -152,7 +152,7 @@ az network vnet create \
152
152
--subnet-prefix 10.0.0.0/24
153
153
```
154
154
155
-
In this example, a service endpoint for *Microsoft.Storage* is created for the subnet *subnet-1*:
155
+
In this example, a service endpoint for `Microsoft.Storage` is created for the subnet *subnet-1*:
156
156
157
157
```azurecli-interactive
158
158
az network vnet subnet create \
@@ -163,12 +163,11 @@ az network vnet subnet create \
163
163
--service-endpoints Microsoft.Storage
164
164
```
165
165
166
-
167
166
---
168
167
169
168
## Restrict network access for the subnet
170
169
171
-
Create a network security group and rules to restrict network access for the subnet.
170
+
Create a network security group and rules that restrict network access for the subnet.
172
171
173
172
### Create a network security group
174
173
@@ -178,7 +177,7 @@ Create a network security group and rules to restrict network access for the sub
178
177
179
178
1. Select **+ Create** to create a new network security group.
180
179
181
-
1. In the **Basics** tab of **Create network security group**, enter or select the following information.
180
+
1. In the **Basics** tab of **Create network security group**, enter, or select the following information.
182
181
183
182
| Setting | Value |
184
183
| -------| ------- |
@@ -394,7 +393,7 @@ The steps necessary to restrict network access to resources created through Azur
394
393
| Subscription | Select your subscription. |
395
394
| Resource group | Select **test-rg**. |
396
395
|**Instance details**||
397
-
| Storage account name | Enter **allowedaccount(random-number)**.</br> **Note: The storage account name must be unique. Add a random number to the end of the name allowedaccount**. |
396
+
| Storage account name | Enter **allowedaccount(random-number)**.</br> **Note: The storage account name must be unique. Add a random number to the end of the name `allowedaccount`**. |
@@ -407,7 +406,7 @@ The steps necessary to restrict network access to resources created through Azur
407
406
408
407
1. Select **Create**.
409
408
410
-
1. Repeat the steps above to create another storage account with the following information.
409
+
1. Repeat the previous steps to create another storage account with the following information.
411
410
412
411
| Setting | Value |
413
412
| -------| ------- |
@@ -428,7 +427,7 @@ $storageAcctParams = @{
428
427
New-AzStorageAccount @storageAcctParams
429
428
```
430
429
431
-
Use the same command to create the denied Azure storage account, but change the name to *deniedaccount*.
430
+
Use the same command to create the denied Azure storage account, but change the name to `deniedaccount`.
432
431
433
432
```azurepowershell-interactive
434
433
$storageAcctParams = @{
@@ -455,7 +454,7 @@ az storage account create \
455
454
--kind StorageV2
456
455
```
457
456
458
-
Use the same command to create the denied Azure storage account, but change the name to *deniedaccount*.
457
+
Use the same command to create the denied Azure storage account, but change the name to `deniedaccount`.
459
458
460
459
```azurecli-interactive
461
460
storageAcctName2="deniedaccount"
@@ -491,13 +490,13 @@ az storage account create \
491
490
492
491
1. Select **Create**.
493
492
494
-
1. Repeat the steps above to create a file share in **deniedaccount(random-number)**.
493
+
1. Repeat the previous steps to create a file share in **deniedaccount(random-number)**.
495
494
496
495
### [PowerShell](#tab/powershell)
497
496
498
497
### Create allowed storage account file share
499
498
500
-
Use [Get-AzStorageAccountKey](/powershell/module/az.storage/get-azstorageaccountkey) to get the storage account key for the allowed storage account. You will use this key in the next step to create a file share in the allowed storage account.
499
+
Use [Get-AzStorageAccountKey](/powershell/module/az.storage/get-azstorageaccountkey) to get the storage account key for the allowed storage account. You'll use this key in the next step to create a file share in the allowed storage account.
Use [Get-AzStorageAccountKey](/powershell/module/az.storage/get-azstorageaccountkey) to get the storage account key for the allowed storage account. You will use this key in the next step to create a file share in the denied storage account.
524
+
Use [Get-AzStorageAccountKey](/powershell/module/az.storage/get-azstorageaccountkey) to get the storage account key for the allowed storage account. You'll use this key in the next step to create a file share in the denied storage account.
526
525
527
526
```azurepowershell-interactive
528
527
$storageAcctName2 = "deniedaccount"
@@ -619,11 +618,11 @@ By default, storage accounts accept network connections from clients in any netw
619
618
620
619
1. Select **Save**.
621
620
622
-
1. Repeat the steps above to deny network access to **deniedaccount(random-number)**.
621
+
1. Repeat the previous steps to deny network access to **deniedaccount(random-number)**.
623
622
624
623
### [PowerShell](#tab/powershell)
625
624
626
-
Use [Update-AzStorageAccountNetworkRuleSet](/powershell/module/az.storage/update-azstorageaccountnetworkruleset) to deny access to the storage accounts except from the virtual network and subnet you created eariler. Once network access is denied, the storage account is not accessible from any network.
625
+
Use [Update-AzStorageAccountNetworkRuleSet](/powershell/module/az.storage/update-azstorageaccountnetworkruleset) to deny access to the storage accounts except from the virtual network and subnet you created earlier. Once network access is denied, the storage account isn't accessible from any network.
By default, storage accounts accept network connections from clients in any network. To limit access to selected networks, change the default action to *Deny* with [az storage account update](/cli/azure/storage/account). Once network access is denied, the storage account is not accessible from any network.
675
+
By default, storage accounts accept network connections from clients in any network. To limit access to selected networks, change the default action to *Deny* with [az storage account update](/cli/azure/storage/account). Once network access is denied, the storage account isn't accessible from any network.
677
676
678
677
```azurecli-interactive
679
678
az storage account update \
@@ -709,7 +708,7 @@ az storage account network-rule add \
709
708
710
709
## Apply policy to allow access to valid storage account
711
710
712
-
To make sure the users in the virtual network can only access the Azure Storage accounts that are safe and allowed, you can create a service endpoint policy with the list of allowed storage accounts in the definition. This policy is then applied to the virtual network subnet which is connected to storage via service endpoints.
711
+
You can create a service endpoint policy. The policy ensures users in the virtual network can only access safe and allowed Azure Storage accounts. This policy contains a list of allowed storage accounts applied to the virtual network subnet that is connected to storage via service endpoints.
713
712
714
713
### Create a service endpoint policy
715
714
@@ -754,7 +753,7 @@ This section creates the policy definition with the list of allowed resources fo
754
753
755
754
### [PowerShell](#tab/powershell)
756
755
757
-
Use [Get-AzStorageAccount](/powershell/module/az.storage/get-azstorageaccount) to retrieve the resource ID for the first (allowed) storage account.
756
+
To retrieve the resource ID for the first (allowed) storage account, use [Get-AzStorageAccount](/powershell/module/az.storage/get-azstorageaccount).
Use [New-AzServiceEndpointPolicyDefinition](/powershell/module/az.network/new-azserviceendpointpolicydefinition)to create the policy definition to allow the above resource.
766
+
To create the policy definition to allow the previous resource, use [New-AzServiceEndpointPolicyDefinition](/powershell/module/az.network/new-azserviceendpointpolicydefinition) .
Service endpoint policies are applied over service endpoints. We will start by creating a service endpoint policy. We will then create the policy definitions under this policy for Azure Storage accounts to be approved for this subnet
792
+
Service endpoint policies are applied over service endpoints. Start by creating a service endpoint policy. Then create the policy definitions under this policy for Azure Storage accounts to be approved for this subnet
794
793
795
794
Use [az storage account show](/cli/azure/storage/account) to get the resource ID for the storage account that is allowed.
796
795
@@ -888,7 +887,7 @@ To test network access to a storage account, deploy a VM in the subnet.
888
887
889
888
1. In the search box in the portal, enter **Virtual machines**. Select **Virtual machines** in the search results.
890
889
891
-
1. In the **Basics** tab of **Create a virtual machine**, enter or select the following information:
890
+
1. In the **Basics** tab of **Create a virtual machine**, enter, or select the following information:
892
891
893
892
| Setting | Value |
894
893
| -------| ------- |
@@ -900,7 +899,7 @@ To test network access to a storage account, deploy a VM in the subnet.
@@ -916,7 +915,7 @@ To test network access to a storage account, deploy a VM in the subnet.
916
915
| -------| ------- |
917
916
|**Network interface**||
918
917
| Virtual network | Select **vnet-1**. |
919
-
| Subnet | Select **subnet-1* (10.0.0.0/24)*. |
918
+
| Subnet | Select **subnet-1 (10.0.0.0/24)**. |
920
919
| Public IP | Select **None**. |
921
920
| NIC network security group | Select **None**. |
922
921
@@ -926,7 +925,7 @@ To test network access to a storage account, deploy a VM in the subnet.
926
925
927
926
### [PowerShell](#tab/powershell)
928
927
929
-
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 are 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.
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
929
931
930
```azurepowershell-interactive
932
931
$vmParams = @{
@@ -967,7 +966,7 @@ az vm create \
967
966
968
967
1. Expand **Security + networking** and select **Access keys**.
969
968
970
-
1. Copy the **key1** value. You will use this key to map a drive to the storage account from the virtual machine you created earlier.
969
+
1. Copy the **key1** value. You use this key to map a drive to the storage account from the virtual machine you created earlier.
971
970
972
971
1. In the search box in the portal, enter **Virtual machines**. Select **Virtual machines** in the search results.
973
972
@@ -1007,7 +1006,7 @@ az vm create \
1007
1006
1008
1007
1. Expand **Security + networking** and select **Access keys**.
1009
1008
1010
-
1. Copy the **key1** value. You will use this key to map a drive to the storage account from the virtual machine you created earlier.
1009
+
1. Copy the **key1** value. You use this key to map a drive to the storage account from the virtual machine you created earlier.
1011
1010
1012
1011
1. In the search box in the portal, enter **Virtual machines**. Select **Virtual machines** in the search results.
1013
1012
@@ -1031,7 +1030,7 @@ az vm create \
1031
1030
1032
1031
1. Select **Run**.
1033
1032
1034
-
1. You will receive the following error message in the **Output** box:
1033
+
1. You receive the following error message in the **Output** box:
0 commit comments