From 4e9fe14e5713ff1fce4923b6a5524b7a1b3cd662 Mon Sep 17 00:00:00 2001 From: Tiberiu Covaci <3577486+tibor19@users.noreply.github.com> Date: Wed, 14 Apr 2021 17:58:16 +0200 Subject: [PATCH] Remove the need for NSG The VM does not need to have an NSG as there is no public IP address associated with it, and some customers have locked down subscriptions that do not allow NSG creation. The VM does not need to be allocated either until challenge 3, so why not deallocating it after is created? --- byos/containers/deploy/deploy.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/byos/containers/deploy/deploy.sh b/byos/containers/deploy/deploy.sh index 104a63d..c5e3c71 100644 --- a/byos/containers/deploy/deploy.sh +++ b/byos/containers/deploy/deploy.sh @@ -138,13 +138,16 @@ then fi # Create VM -az vm create -n internal-vm -g $teamRG --admin-username azureuser --generate-ssh-keys --public-ip-address "" --image UbuntuLTS --vnet-name vnet --subnet vm-subnet +az vm create -n internal-vm -g $teamRG --admin-username azureuser --generate-ssh-keys --public-ip-address "" --image UbuntuLTS --vnet-name vnet --subnet vm-subnet --nsg-rule NONE if [ $? == 0 ]; then echo "VM created successfully in subnet" fi +# Deallocate the VM as it is only used in Challenge 3 +az vm deallocate -n internal-vm -g $teamRG + # Create Azure SQL Server instance echo "Creating Azure SQL Server instance..." az sql server create -l $region -g $teamRG -n $sqlServerName -u $sqlServerUsername -p $sqlServerPassword