Skip to content

Commit 376560d

Browse files
committed
azlocal to az
1 parent 8bd4d97 commit 376560d

8 files changed

Lines changed: 37 additions & 62 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 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
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
129129
echo "[DEBUG] Setting default subscription..."
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"
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"
133133
else
134-
echo "[DEBUG] azlocal not found, using standard az login with service principal..."
134+
echo "[DEBUG] az 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 azlocal >/dev/null 2>&1; then
192-
RG_LIST=$(azlocal group list --query "[].name" -o tsv 2>/dev/null || echo "")
191+
if command -v az >/dev/null 2>&1; then
192+
RG_LIST=$(az 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-
azlocal group delete --name "$rg" --yes --no-wait 2>/dev/null || true
197+
az group delete --name "$rg" --yes --no-wait 2>/dev/null || true
198198
fi
199199
done
200200
sleep 2

samples/aci-blob-storage/python/scripts/cleanup.sh

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,6 @@ KEY_VAULT_NAME="${PREFIX}acikv"
1616
ACR_NAME="${PREFIX}aciacr"
1717
STORAGE_ACCOUNT_NAME="${PREFIX}acistorage"
1818

19-
# Choose the appropriate CLI based on the environment
20-
if [[ $ENVIRONMENT == "LocalStack" ]]; then
21-
AZ="azlocal"
22-
else
23-
AZ="az"
24-
fi
25-
2619
echo "============================================================"
2720
echo "Cleaning up ACI Vacation Planner Resources"
2821
echo "============================================================"

samples/aci-blob-storage/python/scripts/validate.sh

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,6 @@ ACI_GROUP_NAME="${PREFIX}-aci-planner"
1919
PASS_COUNT=0
2020
FAIL_COUNT=0
2121

22-
# Choose the appropriate CLI based on the environment
23-
if [[ $ENVIRONMENT == "LocalStack" ]]; then
24-
AZ="azlocal"
25-
else
26-
AZ="az"
27-
fi
28-
2922
check() {
3023
local description="$1"
3124
local command="$2"

samples/aci-blob-storage/python/terraform/deploy.sh

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,6 @@ CURRENT_DIR="$(cd "$(dirname "$0")" && pwd)"
1111
# Change the current directory to the script's directory
1212
cd "$CURRENT_DIR" || exit
1313

14-
# Choose the appropriate CLI based on the environment
15-
if [[ $ENVIRONMENT == "LocalStack" ]]; then
16-
echo "Using azlocal for LocalStack emulator environment."
17-
AZ="azlocal"
18-
else
19-
echo "Using standard terraform and az for AzureCloud environment."
20-
AZ="az"
21-
fi
22-
2314
# =============================================================================
2415
# Build and push the Docker image before Terraform deployment
2516
# (Terraform references the pre-created ACR as a data source)

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

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ 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
3130
-h, --help Show this help
3231
EOF
3332
}
@@ -59,8 +58,8 @@ fi
5958
INTERCEPTION_STARTED="false"
6059
AZURE_CONFIG_DIR_CREATED="false"
6160
finish() {
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
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
6463
fi
6564
if [[ "$AZURE_CONFIG_DIR_CREATED" == "true" && -n "${AZURE_CONFIG_DIR:-}" && -d "$AZURE_CONFIG_DIR" ]]; then
6665
rm -rf "$AZURE_CONFIG_DIR"
@@ -69,17 +68,17 @@ finish() {
6968
trap finish EXIT
7069

7170
if [[ "$USE_LOCALSTACK" == "true" ]]; then
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
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
7372
export AZURE_CONFIG_DIR="$AZ_TEMP_CONFIG_DIR"; AZURE_CONFIG_DIR_CREATED="true"
7473
echo "Using isolated AZURE_CONFIG_DIR at: $AZURE_CONFIG_DIR"
75-
if ! command -v azlocal >/dev/null 2>&1; then
76-
echo "Error: --use-localstack specified but 'azlocal' was not found in PATH." >&2
74+
if ! command -v az >/dev/null 2>&1; then
75+
echo "Error: --use-localstack specified but 'az' was not found in PATH." >&2
7776
exit 1
7877
fi
79-
if azlocal start-interception; then
78+
if az start-interception; then
8079
INTERCEPTION_STARTED="true"; echo "LocalStack interception started."
8180
else
82-
echo "Error: azlocal failed to start interception. Ensure LocalStack is running and azlocal is configured correctly." >&2
81+
echo "Error: az failed to start interception. Ensure LocalStack is running and az is configured correctly." >&2
8382
exit 1
8483
fi
8584
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 azlocal >/dev/null 2>&1; then
158-
azlocal stop-interception >/dev/null 2>&1 || true
157+
if [[ "$INTERCEPTION_STARTED" == "true" ]] && command -v az >/dev/null 2>&1; then
158+
az 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 azlocal start-interception; then
179+
if az 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

samples/web-app-cosmosdb-nosql-api/python/scripts/call-web-app.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ get_docker_container_port_mapping() {
6868
call_web_app() {
6969
# Get the web app name
7070
echo "Getting web app name..."
71-
web_app_name=$(azlocal webapp list --query '[0].name' --output tsv)
71+
web_app_name=$(az webapp list --query '[0].name' --output tsv)
7272

7373
if [ -n "$web_app_name" ]; then
7474
echo "Web app [$web_app_name] successfully retrieved."
@@ -79,7 +79,7 @@ call_web_app() {
7979

8080
# Get the resource group name
8181
echo "Getting resource group name for web app [$web_app_name]..."
82-
resource_group_name=$(azlocal webapp list --query '[0].resourceGroup' --output tsv)
82+
resource_group_name=$(az webapp list --query '[0].resourceGroup' --output tsv)
8383

8484
if [ -n "$resource_group_name" ]; then
8585
echo "Resource group [$resource_group_name] successfully retrieved."
@@ -90,7 +90,7 @@ call_web_app() {
9090

9191
# Get the the default host name of the web app
9292
echo "Getting the default host name of the web app [$web_app_name]..."
93-
app_host_name=$(azlocal webapp show \
93+
app_host_name=$(az webapp show \
9494
--name "$web_app_name" \
9595
--resource-group "$resource_group_name" \
9696
--query 'defaultHostName' \

samples/web-app-cosmosdb-nosql-api/python/scripts/deploy.sh

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,21 @@ AZURECOSMOSDB_CONTAINERNAME="activities_${RANDOM_SUFFIX}"
1818
AURECOSMOSDB_PARTITION_KEY="/partitionKey"
1919

2020
# Start azure CLI local mode session
21-
azlocal login
21+
az login
2222

2323
# Change the current directory to the script's directory
2424
#cd "$CURRENT_DIR" || exit
2525

2626
# Validates if the resource group exists in the subscription, if not creates it
2727
echo "Checking if resource group [$RESOURCE_GROUP_NAME] exists..."
28-
azlocal group show --name $RESOURCE_GROUP_NAME &>/dev/null
28+
az group show --name $RESOURCE_GROUP_NAME &>/dev/null
2929

3030
if [[ $? != 0 ]]; then
3131
echo "No resource group [$RESOURCE_GROUP_NAME] exists"
3232
echo "Creating resource group [$RESOURCE_GROUP_NAME]..."
3333

3434
# Create the resource group
35-
azlocal group create \
35+
az group create \
3636
--name $RESOURCE_GROUP_NAME \
3737
--location $LOCATION \
3838
--only-show-errors 1> /dev/null \
@@ -48,7 +48,7 @@ else
4848
fi
4949

5050
echo "Create CosmosDB NoSQL Account"
51-
export AZURECOSMOSDB_ENDPOINT=$(azlocal cosmosdb create \
51+
export AZURECOSMOSDB_ENDPOINT=$(az cosmosdb create \
5252
--resource-group $RESOURCE_GROUP_NAME \
5353
--name $WEB_APP_NAME \
5454
--locations regionName=$LOCATION \
@@ -59,13 +59,13 @@ echo "Account created"
5959
echo "AZURECOSMOSDB_ENDPOINT set to $AZURECOSMOSDB_ENDPOINT"
6060

6161
echo "Create CosmosDB NoSQL Database"
62-
azlocal cosmosdb sql database create \
62+
az cosmosdb sql database create \
6363
--resource-group $RESOURCE_GROUP_NAME \
6464
--name $AZURECOSMOSDB_DATABASENAME \
6565
--account-name $WEB_APP_NAME
6666

6767
echo "Create CosmosDB NoSQL Container"
68-
azlocal cosmosdb sql container create \
68+
az cosmosdb sql container create \
6969
--resource-group $RESOURCE_GROUP_NAME \
7070
--account-name $WEB_APP_NAME \
7171
--database-name $AZURECOSMOSDB_DATABASENAME \
@@ -74,23 +74,23 @@ azlocal cosmosdb sql container create \
7474
--throughput 400
7575

7676
echo "Fetching DB Account primary master key"
77-
export AZURECOSMOSDB_PRIMARY_KEY=$(azlocal cosmosdb keys list \
77+
export AZURECOSMOSDB_PRIMARY_KEY=$(az cosmosdb keys list \
7878
--resource-group $RESOURCE_GROUP_NAME \
7979
--name $WEB_APP_NAME \
8080
--query "primaryMasterKey" \
8181
--output tsv)
8282
echo "Primary master key is $AZURECOSMOSDB_PRIMARY_KEY"
8383

8484
echo "Creating App service"
85-
azlocal appservice plan create --name $WEB_APP_NAME --resource-group $RESOURCE_GROUP_NAME --sku B1 --is-linux
85+
az appservice plan create --name $WEB_APP_NAME --resource-group $RESOURCE_GROUP_NAME --sku B1 --is-linux
8686
echo "App service created"
8787

8888
echo "Creating Web App"
89-
azlocal webapp create --name $WEB_APP_NAME --resource-group $RESOURCE_GROUP_NAME --plan $WEB_APP_NAME --runtime PYTHON:3.13
89+
az webapp create --name $WEB_APP_NAME --resource-group $RESOURCE_GROUP_NAME --plan $WEB_APP_NAME --runtime PYTHON:3.13
9090
echo "Web App created"
9191

9292
echo "Configure appsettings environment variables"
93-
azlocal webapp config appsettings set \
93+
az webapp config appsettings set \
9494
--resource-group $RESOURCE_GROUP_NAME \
9595
--name $WEB_APP_NAME \
9696
--settings AZURECOSMOSDB_ENDPOINT=$AZURECOSMOSDB_ENDPOINT \
@@ -100,7 +100,7 @@ azlocal webapp config appsettings set \
100100

101101
# Print the application settings of the web app
102102
echo "Retrieving application settings for web app [$WEB_APP_NAME]..."
103-
azlocal webapp config appsettings list \
103+
az webapp config appsettings list \
104104
--resource-group $RESOURCE_GROUP_NAME \
105105
--name $WEB_APP_NAME
106106

@@ -118,8 +118,7 @@ zip -r "$ZIPFILE" app.py cosmosdb_client.py static templates requirements.txt
118118

119119
# Deploy the web app
120120
echo "Deploying web app [$WEB_APP_NAME] with zip file [$ZIPFILE]..."
121-
echo "Using azlocal webapp deploy command for LocalStack emulator environment."
122-
azlocal webapp deploy \
121+
az webapp deploy \
123122
--resource-group $RESOURCE_GROUP_NAME \
124123
--name $WEB_APP_NAME \
125124
--src-path ${ZIPFILE} \

0 commit comments

Comments
 (0)