-
Notifications
You must be signed in to change notification settings - Fork 0
/
storage.azcli
executable file
·20 lines (15 loc) · 2.13 KB
/
storage.azcli
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
RESOURCE_GROUP='OpenAI-Demo'
VNET_NAME='vnet-1'
PV_SUBNET_NAME='PrivateLink-Subnet'
STORAGE_NAME=a$(cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 23 | head -n 1)
az storage account create --name $STORAGE_NAME --resource-group $RESOURCE_GROUP --sku Standard_LRS --kind StorageV2 --enable-large-file-share --default-action Deny
#blob
az network private-endpoint create --name blob-storage-privateLink --resource-group $RESOURCE_GROUP --vnet-name $VNET_NAME --subnet $PV_SUBNET_NAME --private-connection-resource-id $(az storage account show --name $STORAGE_NAME --resource-group $RESOURCE_GROUP --query id --output tsv) --group-id blob --connection-name blob-storage-connection
az network private-dns zone create --name privatelink.blob.core.windows.net --resource-group $RESOURCE_GROUP
az network private-dns link vnet create --name blob-storage-dns-link --resource-group $RESOURCE_GROUP --virtual-network $VNET_NAME --zone-name privatelink.blob.core.windows.net --registration-enabled false
az network private-endpoint dns-zone-group create --endpoint-name blob-storage-privateLink --name blob-storage-dns-zone-group --private-dns-zone privatelink.blob.core.windows.net --zone-name privatelink.blob.core.windows.net --resource-group $RESOURCE_GROUP
#file
az network private-endpoint create --name file-storage-privateLink --resource-group $RESOURCE_GROUP --vnet-name $VNET_NAME --subnet $PV_SUBNET_NAME --private-connection-resource-id $(az storage account show --name $STORAGE_NAME --resource-group $RESOURCE_GROUP --query id --output tsv) --group-id file --connection-name file-storage-connection
az network private-dns zone create --name privatelink.file.core.windows.net --resource-group $RESOURCE_GROUP
az network private-dns link vnet create --name file-storage-dns-link --resource-group $RESOURCE_GROUP --virtual-network $VNET_NAME --zone-name privatelink.file.core.windows.net --registration-enabled false
az network private-endpoint dns-zone-group create --endpoint-name file-storage-privateLink --name file-storage-dns-zone-group --private-dns-zone privatelink.file.core.windows.net --zone-name privatelink.file.core.windows.net --resource-group $RESOURCE_GROUP