@@ -26,15 +26,14 @@ steps:
2626 SUBSCRIPTION_ID=$(az account show | jq -rc '.id')
2727
2828 # Get Pipeline Build Subscriptions.
29- INFRA_RG_LIST=$(az group list --query '[? tags."$ACNCI_BUILDTAG_DEFINITIONID" && tags."$ACNCI_BUILDTAG_CREATEDBYAPPID"]' -o json)
30- INFRA_RG_LIST=$(echo "$INFRA_RG_LIST" | \
31- jq -rc \
32- --arg SP_APPID "$servicePrincipalId" \
33- --arg CREATEDBY_APPID_TAG "$ACNCI_BUILDTAG_CREATEDBYAPPID" \
34- --arg DEFINITIONID "$SYSTEM_DEFINITIONID" \
35- --arg DEFINITIONID_TAG "$ACNCI_BUILDTAG_DEFINITIONID" \
36- '.[] | select(.tags["$CREATEDBYAPPID_TAG"] == $SP_APPID) | select(.tags["$DEFINITIONID_TAG"] == $DEFINITIONID)' )
29+ R_QUERY='[? tags."$ACNCI_BUILDTAG_DEFINITIONID" && tags."$ACNCI_BUILDTAG_CREATEDBYAPPID"]'
30+ INFRA_RG_LIST=$(az group list --query "$R_QUERY" \
31+ --tag "$ACNCI_BUILDTAG_DEFINITIONID"="$SYSTEM_DEFINITIONID" \
32+ --tag "$ACNCI_BUILDTAG_CREATEDBYAPPID"="$servicePrincipalId" -o json
33+ echo "$INFRA_RG_LIST"
34+
3735 INFRA_RG_LENGTH=$(echo "$INFRA_RG_LIST" | jq length)
36+ echo "$INFRA_RG_LIST_LENGTH"
3837
3938 if [[ -z $INFRA_RG_LENGTH ]] || \
4039 (( $INFRA_RG_LENGTH < $ACNCI_SA_POOL_SIZE )); then
@@ -131,6 +130,8 @@ steps:
131130
132131# Select Storage Account for use.
133132- bash : |
133+ [[ -n $SYSTEM_DEBUG ]] && [[ $SYSTEM_DEBUG =~ $IS_TRUE ]] && set -x || set +x
134+
134135 if (( "$SA_LIST_LENGTH" > 0 )); then
135136 SA_RANDOM_SELECT=`tr -dc '1-9' < /dev/urandom | head -c${1:-7}`
136137 R_INDEX=$(( "$SA_RANDOM_SELECT" % "$SA_LIST_LENGTH" ))
@@ -153,6 +154,8 @@ steps:
153154 inlineScript : |
154155 set -e
155156
157+ [[ -n $SYSTEM_DEBUG ]] && [[ $SYSTEM_DEBUG =~ $IS_TRUE ]] && set -x || set +x
158+
156159 # Make a random selection from the pool
157160 SA_DATA=$(echo "$SA_LIST" | jq --argjson IDX "$SA_IDX" -rc '.[$IDX]')
158161 echo "Delete me"
0 commit comments