From cb72478b99483bd149f2257c6b2189a137ced9a1 Mon Sep 17 00:00:00 2001 From: Gerd Oberlechner Date: Sat, 14 Dec 2024 22:03:52 +0100 Subject: [PATCH] fix query for NSG in demo scripts select the proper customer RG when querying for the NSG. Signed-off-by: Gerd Oberlechner --- demo/03-create-cluster.sh | 2 +- demo/env_vars | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/demo/03-create-cluster.sh b/demo/03-create-cluster.sh index b996c1c60..bbe8681bb 100755 --- a/demo/03-create-cluster.sh +++ b/demo/03-create-cluster.sh @@ -7,7 +7,7 @@ CURRENT_DATE=$(date -u +"%Y-%m-%dT%H:%M:%S+00:00") CLUSTER_TMPL_FILE="cluster.tmpl.json" CLUSTER_FILE="cluster.json" -NSG_ID=$(az network nsg list --query "[?name=='${CUSTOMER_NSG}'].id" -o tsv) +NSG_ID=$(az network nsg list -g ${CUSTOMER_RG_NAME} --query "[?name=='${CUSTOMER_NSG}'].id" -o tsv) SUBNET_ID=$(az network vnet subnet show -g ${CUSTOMER_RG_NAME} --vnet-name ${CUSTOMER_VNET_NAME} --name ${CUSTOMER_VNET_SUBNET1} --query id -o tsv) SUBSCRIPTION_ID=$(az account show --query id -o tsv) diff --git a/demo/env_vars b/demo/env_vars index ccfc2092d..25030a402 100644 --- a/demo/env_vars +++ b/demo/env_vars @@ -1,7 +1,9 @@ #!/bin/bash -export CUSTOMER_RG_NAME="$USER-net-rg" +if [ -z "$CUSTOMER_RG_NAME" ]; then + export CUSTOMER_RG_NAME="$USER-net-rg" +fi export CUSTOMER_VNET_NAME="customer-vnet" export CUSTOMER_VNET_SUBNET1="customer-subnet-1" export CUSTOMER_NSG="customer-nsg"