@@ -6,11 +6,13 @@ SUBSCRIPTION_ID=$1
66LOCATION=$2
77RG=$3
88SA1_NAME=$4 # Storage account 1
9+
910VNET_A1=" cx_vnet_a1"
11+ VNET_A2=" cx_vnet_a2"
12+ VNET_A3=" cx_vnet_a3"
1013SUBNET_PE_A1=" pe"
1114PE_NAME=" ${SA1_NAME} -pe"
1215PRIVATE_DNS_ZONE=" privatelink.blob.core.windows.net"
13- LINK_NAME=" ${VNET_A1} -link"
1416
1517# 1. Create Private DNS zone
1618echo " ==> Creating Private DNS zone: $PRIVATE_DNS_ZONE "
@@ -20,12 +22,27 @@ az network private-dns zone create -g "$RG" -n "$PRIVATE_DNS_ZONE" --output none
2022# 2. Link DNS zone to VNet
2123echo " ==> Linking DNS zone $PRIVATE_DNS_ZONE to VNet $VNET_A1 "
2224az network private-dns link vnet create \
23- -g " $RG " -n " $LINK_NAME " \
25+ -g " $RG " -n " ${VNET_A1} -link " \
2426 --zone-name " $PRIVATE_DNS_ZONE " \
2527 --virtual-network " $VNET_A1 " \
26- --registration-enabled false --output none \
28+ --registration-enabled false \
2729 && echo " [OK] Linked DNS zone to $VNET_A1 ."
2830
31+ az network private-dns link vnet create \
32+ -g " $RG " -n " ${VNET_A2} -link" -\
33+ -zone-name " $PRIVATE_DNS_ZONE " \
34+ --virtual-network " $VNET_A2 " \
35+ --registration-enabled false \
36+ && echo " [OK] Linked DNS zone to $VNET_A2 ."
37+
38+ az network private-dns link vnet create \
39+ -g " $RG " -n " ${VNET_A3} -link" \
40+ --zone-name " $PRIVATE_DNS_ZONE " \
41+ --virtual-network " $VNET_A3 " \
42+ --registration-enabled false \
43+ && echo " [OK] Linked DNS zone to $VNET_A3 ."
44+
45+
2946# 3. Create Private Endpoint
3047echo " ==> Creating Private Endpoint for Storage Account: $SA1_NAME "
3148SA1_ID=$( az storage account show -g " $RG " -n " $SA1_NAME " --query id -o tsv)
0 commit comments