Skip to content

Commit 0d31ebf

Browse files
committed
cli changes
1 parent 96bfee6 commit 0d31ebf

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

articles/storage/files/storage-files-configure-s2s-vpn.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Learn how to configure a site-to-site (S2S) VPN for use with Azure
44
author: khdownie
55
ms.service: azure-file-storage
66
ms.topic: how-to
7-
ms.date: 09/05/2024
7+
ms.date: 09/06/2024
88
ms.author: kendownie
99
---
1010

@@ -150,14 +150,28 @@ To add a new or existing virtual network to your storage account, follow these s
150150
az login
151151
```
152152

153-
1. If you want to add a new virtual network and gateway subnet, run the following script. If you have an existing virtual network that you want to use, then skip this step and proceed to step 3. Be sure to replace `<your-subscription-id>`, `<resource-group>`, and `<storage-account-name>` with your own values. Replace `<virtual-network-name>` with the name of the new virtual network you want to create. The `--address-prefix` and `--subnet-prefix` parameters define the IP address blocks for the virtual network and the subnet, so replace those with your respective values. The virtual network will be created in the same region as the resource group.
153+
1. If you want to add a new virtual network and gateway subnet, run the following script. If you have an existing virtual network that you want to use, then skip this step and proceed to step 3. Be sure to replace `<your-subscription-id>`, `<storage-account-name>`, and `<resource-group>` with your own values. Replace `<virtual-network-name>` with the name of the new virtual network you want to create. The `--address-prefix` and `--subnet-prefix` parameters define the IP address blocks for the virtual network and the subnet, so replace those with your respective values. The virtual network will be created in the same region as the resource group.
154154

155155
```azurecli-interactive
156156
# Set your subscription
157157
az account set --subscription "<your-subscription-id>"
158158
159-
# Create a virtual network and subnet. Virtual network gateway can only be created in subnet with name 'GatewaySubnet'.
160-
az network vnet create --resource-group <resource-group> --name <virtual-network-name> --address-prefix 10.0.0.0/16 --subnet-name GatewaySubnet --subnet-prefix 10.0.0.0/24
159+
# Define parameters
160+
storageAccount="<storage-account-name>"
161+
resourceGroup="<resource-group>"
162+
vnetName="<virtual-network-name>"
163+
# Virtual network gateway can only be created in subnet with name 'GatewaySubnet'.
164+
subnetName="GatewaySubnet"
165+
vnetAddressPrefix = "10.0.0.0/16" # Update this address per your requirements
166+
subnetAddressPrefix="10.0.0.0/24" # Update this address per your requirements
167+
168+
# Create a virtual network and subnet
169+
az network vnet create \
170+
--resource-group $resourceGroup \
171+
--name $vnetName \
172+
--address-prefix $vnetAddressPrefix \
173+
--subnet-name $subnetName \
174+
--subnet-prefix $subnetAddressPrefix
161175
```
162176

163177
1. If you created a new virtual network and subnet in the previous step, then skip this step. If you have an existing virtual network you want to use, you must first create a [gateway subnet](../../vpn-gateway/vpn-gateway-about-vpn-gateway-settings.md#gwsub) on the virtual network before you can deploy a virtual network gateway.

0 commit comments

Comments
 (0)