Skip to content

Commit d2662f4

Browse files
committed
revert start-interception calls
1 parent 376560d commit d2662f4

3 files changed

Lines changed: 23 additions & 22 deletions

File tree

run-samples.sh

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -121,17 +121,17 @@ if [ -n "${AZURE_CONFIG_DIR:-}" ]; then
121121
mkdir -p "$AZURE_CONFIG_DIR"
122122
fi
123123

124-
if command -v az >/dev/null 2>&1; then
125-
echo "[DEBUG] az command found, attempting login..."
126-
az login || true
127-
echo "[DEBUG] Starting az interception..."
128-
az start-interception
124+
if command -v azlocal >/dev/null 2>&1; then
125+
echo "[DEBUG] azlocal command found, attempting login..."
126+
azlocal login || true
127+
echo "[DEBUG] Starting azlocal interception..."
128+
azlocal start-interception
129129
echo "[DEBUG] Setting default subscription..."
130-
az account set --subscription "00000000-0000-0000-0000-000000000000" || true
131-
echo "[DEBUG] Checking az account status..."
132-
az account show --query "{Environment:environmentName, Subscription:id}" --output json 2>&1 || echo "[DEBUG] az account show failed"
130+
azlocal account set --subscription "00000000-0000-0000-0000-000000000000" || true
131+
echo "[DEBUG] Checking azlocal account status..."
132+
azlocal account show --query "{Environment:environmentName, Subscription:id}" --output json 2>&1 || echo "[DEBUG] azlocal account show failed"
133133
else
134-
echo "[DEBUG] az not found, using standard az login with service principal..."
134+
echo "[DEBUG] azlocal not found, using standard az login with service principal..."
135135
az login --service-principal -u any-app -p any-pass --tenant any-tenant || true
136136
echo "[DEBUG] Checking az account status..."
137137
az account show --query "{Environment:environmentName, Subscription:id}" --output json 2>&1 || echo "[DEBUG] az account show failed"
@@ -188,13 +188,13 @@ for (( i=START; i<START+COUNT; i++ )); do
188188

189189
# Clean up Azure resources to prevent state pollution between tests
190190
echo "Cleaning up Azure resources in LocalStack..."
191-
if command -v az >/dev/null 2>&1; then
192-
RG_LIST=$(az group list --query "[].name" -o tsv 2>/dev/null || echo "")
191+
if command -v azlocal >/dev/null 2>&1; then
192+
RG_LIST=$(azlocal group list --query "[].name" -o tsv 2>/dev/null || echo "")
193193
if [[ -n "$RG_LIST" ]]; then
194194
echo "$RG_LIST" | while read -r rg; do
195195
if [[ -n "$rg" ]]; then
196196
echo " - Deleting resource group: $rg"
197-
az group delete --name "$rg" --yes --no-wait 2>/dev/null || true
197+
azlocal group delete --name "$rg" --yes --no-wait 2>/dev/null || true
198198
fi
199199
done
200200
sleep 2

samples/function-app-front-door/python/scripts/cleanup_all.sh

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Usage: $(basename "$0") [--env-file PATH] [--resource-group NAME] [--use-localst
2727
Options:
2828
--env-file PATH Env file produced by deploy_all.sh (e.g., scripts/.last_deploy_all.env)
2929
-g, --resource-group Resource group name to delete
30+
--use-localstack Use azlocal interception to target LocalStack emulator
3031
-h, --help Show this help
3132
EOF
3233
}
@@ -58,8 +59,8 @@ fi
5859
INTERCEPTION_STARTED="false"
5960
AZURE_CONFIG_DIR_CREATED="false"
6061
finish() {
61-
if [[ "$INTERCEPTION_STARTED" == "true" ]] && command -v az >/dev/null 2>&1; then
62-
set +e; az stop-interception >/dev/null 2>&1 || true; set -e
62+
if [[ "$INTERCEPTION_STARTED" == "true" ]] && command -v azlocal >/dev/null 2>&1; then
63+
set +e; azlocal stop-interception >/dev/null 2>&1 || true; set -e
6364
fi
6465
if [[ "$AZURE_CONFIG_DIR_CREATED" == "true" && -n "${AZURE_CONFIG_DIR:-}" && -d "$AZURE_CONFIG_DIR" ]]; then
6566
rm -rf "$AZURE_CONFIG_DIR"
@@ -68,17 +69,17 @@ finish() {
6869
trap finish EXIT
6970

7071
if [[ "$USE_LOCALSTACK" == "true" ]]; then
71-
if command -v mktemp >/dev/null 2>&1; then AZ_TEMP_CONFIG_DIR="$(mktemp -d)"; else AZ_TEMP_CONFIG_DIR="$(pwd)/.az_config_$$"; mkdir -p "$AZ_TEMP_CONFIG_DIR"; fi
72+
if command -v mktemp >/dev/null 2>&1; then AZ_TEMP_CONFIG_DIR="$(mktemp -d)"; else AZ_TEMP_CONFIG_DIR="$(pwd)/.azlocal_config_$$"; mkdir -p "$AZ_TEMP_CONFIG_DIR"; fi
7273
export AZURE_CONFIG_DIR="$AZ_TEMP_CONFIG_DIR"; AZURE_CONFIG_DIR_CREATED="true"
7374
echo "Using isolated AZURE_CONFIG_DIR at: $AZURE_CONFIG_DIR"
74-
if ! command -v az >/dev/null 2>&1; then
75-
echo "Error: --use-localstack specified but 'az' was not found in PATH." >&2
75+
if ! command -v azlocal >/dev/null 2>&1; then
76+
echo "Error: --use-localstack specified but 'azlocal' was not found in PATH." >&2
7677
exit 1
7778
fi
78-
if az start-interception; then
79+
if azlocal start-interception; then
7980
INTERCEPTION_STARTED="true"; echo "LocalStack interception started."
8081
else
81-
echo "Error: az failed to start interception. Ensure LocalStack is running and az is configured correctly." >&2
82+
echo "Error: azlocal failed to start interception. Ensure LocalStack is running and azlocal is configured correctly." >&2
8283
exit 1
8384
fi
8485
fi

samples/function-app-front-door/python/scripts/deploy_all.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ finish() {
154154
[[ -f "$ZIP_MAIN" ]] && rm -f "$ZIP_MAIN"
155155
[[ -f "$ZIP_A" ]] && rm -f "$ZIP_A"
156156
[[ -f "$ZIP_B" ]] && rm -f "$ZIP_B"
157-
if [[ "$INTERCEPTION_STARTED" == "true" ]] && command -v az >/dev/null 2>&1; then
158-
az stop-interception >/dev/null 2>&1 || true
157+
if [[ "$INTERCEPTION_STARTED" == "true" ]] && command -v azlocal >/dev/null 2>&1; then
158+
azlocal stop-interception >/dev/null 2>&1 || true
159159
fi
160160
if [[ "$AZURE_CONFIG_DIR_CREATED" == "true" && -n "${AZURE_CONFIG_DIR:-}" && -d "$AZURE_CONFIG_DIR" ]]; then
161161
rm -rf "$AZURE_CONFIG_DIR"
@@ -176,7 +176,7 @@ if [[ "$USE_LOCALSTACK" == "true" ]]; then
176176
echo "Error: --use-localstack specified but 'azlocal' not found in PATH." >&2
177177
exit 1
178178
fi
179-
if az start-interception; then
179+
if azlocal start-interception; then
180180
INTERCEPTION_STARTED="true"; echo "LocalStack interception started."
181181
else
182182
echo "Error: azlocal failed to start interception. Ensure LocalStack is running." >&2

0 commit comments

Comments
 (0)