Skip to content

Commit 8ef69ae

Browse files
Merge pull request #216195 from roygara/clisanfix
Updating volume group ACL for CLI
2 parents 0171aec + 09e1067 commit 8ef69ae

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

articles/storage/elastic-san/elastic-san-connect-linux.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Learn how to connect to an Azure Elastic SAN (preview) volume from
44
author: roygara
55
ms.service: storage
66
ms.topic: how-to
7-
ms.date: 10/25/2022
7+
ms.date: 10/27/2022
88
ms.author: rogarana
99
ms.subservice: elastic-san
1010
ms.custom: references_regions, ignite-2022
@@ -88,7 +88,10 @@ Add-AzElasticSanVolumeGroupNetworkRule -ResourceGroupName $resourceGroupName -El
8888
# [Azure CLI](#tab/azure-cli)
8989

9090
```azurecli
91-
az elastic-san volume-group update -e $sanName -g $resourceGroupName --name $volumeGroupName --network-acls "{virtualNetworkRules:[{id:/subscriptions/subscriptionID/resourceGroups/RGName/providers/Microsoft.Network/virtualNetworks/vnetName/subnets/default, action:Allow}]}"
91+
# First, get the current length of the list of virtual networks. This is needed to ensure you append a new network instead of replacing existing ones.
92+
virtualNetworkListLength = az elastic-san volume-group show -e $sanName -n $volumeGroupName -g $resourceGroupName --query 'length(networkAcls.virtualNetworkRules)'
93+
94+
az elastic-san volume-group update -e $sanName -g $resourceGroupName --name $volumeGroupName --network-acls virtual-network-rules[$virtualNetworkListLength] "{virtualNetworkRules:[{id:/subscriptions/subscriptionID/resourceGroups/RGName/providers/Microsoft.Network/virtualNetworks/vnetName/subnets/default, action:Allow}]}"
9295
```
9396
---
9497

articles/storage/elastic-san/elastic-san-connect-windows.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Learn how to connect to an Azure Elastic SAN (preview) volume from
44
author: roygara
55
ms.service: storage
66
ms.topic: how-to
7-
ms.date: 10/25/2022
7+
ms.date: 10/27/2022
88
ms.author: rogarana
99
ms.subservice: elastic-san
1010
ms.custom: references_regions, ignite-2022
@@ -88,7 +88,10 @@ Add-AzElasticSanVolumeGroupNetworkRule -ResourceGroupName $resourceGroupName -El
8888
# [Azure CLI](#tab/azure-cli)
8989

9090
```azurecli
91-
az elastic-san volume-group update -e $sanName -g $resourceGroupName --name $volumeGroupName --network-acls "{virtualNetworkRules:[{id:/subscriptions/subscriptionID/resourceGroups/RGName/providers/Microsoft.Network/virtualNetworks/vnetName/subnets/default, action:Allow}]}"
91+
# First, get the current length of the list of virtual networks. This is needed to ensure you append a new network instead of replacing existing ones.
92+
virtualNetworkListLength = az elastic-san volume-group show -e $sanName -n $volumeGroupName -g $resourceGroupName --query 'length(networkAcls.virtualNetworkRules)'
93+
94+
az elastic-san volume-group update -e $sanName -g $resourceGroupName --name $volumeGroupName --network-acls virtual-network-rules[$virtualNetworkListLength] "{virtualNetworkRules:[{id:/subscriptions/subscriptionID/resourceGroups/RGName/providers/Microsoft.Network/virtualNetworks/vnetName/subnets/default, action:Allow}]}"
9295
```
9396
---
9497

articles/storage/elastic-san/elastic-san-networking.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: An overview of Azure Elastic SAN (preview), a service that enables
44
author: roygara
55
ms.service: storage
66
ms.topic: how-to
7-
ms.date: 10/25/2022
7+
ms.date: 10/27/2022
88
ms.author: rogarana
99
ms.subservice: elastic-san
1010
ms.custom: ignite-2022
@@ -223,7 +223,10 @@ You can manage virtual network rules for volume groups through the Azure portal,
223223
> You can use the **subscription** parameter to retrieve the subnet ID for a virtual network belonging to another Azure AD tenant.
224224
225225
```azurecli
226-
az elastic-san volume-group update -e $sanName -g $resourceGroupName --name $volumeGroupName --network-acls "{virtual-network-rules:[{id:/'subscriptions/subscriptionID/resourceGroups/RGName/providers/Microsoft.Network/virtualNetworks/vnetName/subnets/default',action:Allow}]}"
226+
# First, get the current length of the list of virtual networks. This is needed to ensure you append a new network instead of replacing existing ones.
227+
virtualNetworkListLength = az elastic-san volume-group show -e $sanName -n $volumeGroupName -g $resourceGroupName --query 'length(networkAcls.virtualNetworkRules)'
228+
229+
az elastic-san volume-group update -e $sanName -g $resourceGroupName --name $volumeGroupName --network-acls virtual-network-rules[$virtualNetworkListLength] "{virtualNetworkRules:[{id:/subscriptions/subscriptionID/resourceGroups/RGName/providers/Microsoft.Network/virtualNetworks/vnetName/subnets/default, action:Allow}]}"
227230
```
228231
229232
- Remove a network rule. The following command removes the first network rule, modify it to remove the network rule you'd like.

0 commit comments

Comments
 (0)