Skip to content

Commit 9691d33

Browse files
committed
add loggin
1 parent 4c98e89 commit 9691d33

10 files changed

Lines changed: 115 additions & 65 deletions

File tree

samples/function-app-managed-identity/python/terraform/deploy.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,21 @@ fi
3030
if [[ $ENVIRONMENT == "LocalStack" ]]; then
3131
echo "Using tflocal and azlocal for LocalStack emulator environment."
3232
TERRAFORM="tflocal"
33+
34+
# Log Azure auth environment variables before unsetting
35+
echo "[DEBUG] Azure auth env vars before unsetting:"
36+
echo "[DEBUG] ARM_CLIENT_ID=${ARM_CLIENT_ID:-<not set>}"
37+
echo "[DEBUG] ARM_CLIENT_SECRET=${ARM_CLIENT_SECRET:+<set but hidden>}${ARM_CLIENT_SECRET:-<not set>}"
38+
echo "[DEBUG] ARM_TENANT_ID=${ARM_TENANT_ID:-<not set>}"
39+
echo "[DEBUG] ARM_SUBSCRIPTION_ID=${ARM_SUBSCRIPTION_ID:-<not set>}"
40+
echo "[DEBUG] AZURE_CLIENT_ID=${AZURE_CLIENT_ID:-<not set>}"
41+
echo "[DEBUG] AZURE_TENANT_ID=${AZURE_TENANT_ID:-<not set>}"
42+
43+
# Unset Azure auth environment variables to prevent interference from CI secrets
44+
unset ARM_CLIENT_ID ARM_CLIENT_SECRET ARM_TENANT_ID ARM_SUBSCRIPTION_ID
45+
unset AZURE_CLIENT_ID AZURE_CLIENT_SECRET AZURE_TENANT_ID AZURE_SUBSCRIPTION_ID
46+
47+
echo "[DEBUG] Azure auth env vars after unsetting: all cleared"
3348
AZ="azlocal"
3449
else
3550
echo "Using standard terraform and az for AzureCloud environment."
@@ -38,6 +53,7 @@ else
3853
fi
3954

4055
echo "[DEBUG] Cloud name: '$CLOUD_NAME', Environment: '$ENVIRONMENT', Tools: TERRAFORM=$TERRAFORM, AZ=$AZ"
56+
echo "[DEBUG] TERRAFORM command location: $(which $TERRAFORM 2>/dev/null || echo 'not found')"
4157

4258
echo "Initializing Terraform..."
4359
$TERRAFORM init -upgrade

samples/function-app-managed-identity/python/terraform/providers.tf

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,13 @@ provider "azurerm" {
1616
}
1717
}
1818

19-
# LocalStack Azure emulator uses a fixed subscription id
19+
# LocalStack Azure emulator configuration
2020
subscription_id = "00000000-0000-0000-0000-000000000000"
21+
tenant_id = "00000000-0000-0000-0000-000000000000"
22+
client_id = "00000000-0000-0000-0000-000000000000"
23+
client_secret = "fake-secret"
2124

22-
# The following configs are required for local testing
23-
# Skip provider registration and authentication for LocalStack
24-
resource_provider_registrations = "none"
25-
26-
# Use environment variables or static values for LocalStack
27-
tenant_id = "00000000-0000-0000-0000-000000000000"
28-
client_id = "00000000-0000-0000-0000-000000000000"
29-
client_secret = "fake-secret"
30-
31-
# Disable authentication checks
32-
#use_cli = false
33-
#use_msi = false
25+
# Disable CLI and MSI authentication
26+
use_cli = false
27+
use_msi = false
3428
}

samples/function-app-storage-http/dotnet/terraform/deploy.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,21 @@ fi
2929
if [[ $ENVIRONMENT == "LocalStack" ]]; then
3030
echo "Using tflocal and azlocal for LocalStack emulator environment."
3131
TERRAFORM="tflocal"
32+
33+
# Log Azure auth environment variables before unsetting
34+
echo "[DEBUG] Azure auth env vars before unsetting:"
35+
echo "[DEBUG] ARM_CLIENT_ID=${ARM_CLIENT_ID:-<not set>}"
36+
echo "[DEBUG] ARM_CLIENT_SECRET=${ARM_CLIENT_SECRET:+<set but hidden>}${ARM_CLIENT_SECRET:-<not set>}"
37+
echo "[DEBUG] ARM_TENANT_ID=${ARM_TENANT_ID:-<not set>}"
38+
echo "[DEBUG] ARM_SUBSCRIPTION_ID=${ARM_SUBSCRIPTION_ID:-<not set>}"
39+
echo "[DEBUG] AZURE_CLIENT_ID=${AZURE_CLIENT_ID:-<not set>}"
40+
echo "[DEBUG] AZURE_TENANT_ID=${AZURE_TENANT_ID:-<not set>}"
41+
42+
# Unset Azure auth environment variables to prevent interference from CI secrets
43+
unset ARM_CLIENT_ID ARM_CLIENT_SECRET ARM_TENANT_ID ARM_SUBSCRIPTION_ID
44+
unset AZURE_CLIENT_ID AZURE_CLIENT_SECRET AZURE_TENANT_ID AZURE_SUBSCRIPTION_ID
45+
46+
echo "[DEBUG] Azure auth env vars after unsetting: all cleared"
3247
AZ="azlocal"
3348
else
3449
echo "Using standard terraform and az for AzureCloud environment."
@@ -37,6 +52,7 @@ else
3752
fi
3853

3954
echo "[DEBUG] Cloud name: '$CLOUD_NAME', Environment: '$ENVIRONMENT', Tools: TERRAFORM=$TERRAFORM, AZ=$AZ"
55+
echo "[DEBUG] TERRAFORM command location: $(which $TERRAFORM 2>/dev/null || echo 'not found')"
4056

4157
echo "Initializing Terraform..."
4258
$TERRAFORM init -upgrade

samples/function-app-storage-http/dotnet/terraform/providers.tf

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,13 @@ provider "azurerm" {
1616
}
1717
}
1818

19-
# LocalStack Azure emulator uses a fixed subscription id
19+
# LocalStack Azure emulator configuration
2020
subscription_id = "00000000-0000-0000-0000-000000000000"
21+
tenant_id = "00000000-0000-0000-0000-000000000000"
22+
client_id = "00000000-0000-0000-0000-000000000000"
23+
client_secret = "fake-secret"
2124

22-
# The following configs are required for local testing
23-
# Skip provider registration and authentication for LocalStack
24-
resource_provider_registrations = "none"
25-
26-
# Use environment variables or static values for LocalStack
27-
tenant_id = "00000000-0000-0000-0000-000000000000"
28-
client_id = "00000000-0000-0000-0000-000000000000"
29-
client_secret = "fake-secret"
30-
31-
# Disable authentication checks
32-
#use_cli = false
33-
#use_msi = false
25+
# Disable CLI and MSI authentication
26+
use_cli = false
27+
use_msi = false
3428
}

samples/web-app-cosmosdb-mongodb-api/python/terraform/deploy.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,21 @@ fi
2929
if [[ $ENVIRONMENT == "LocalStack" ]]; then
3030
echo "Using tflocal and azlocal for LocalStack emulator environment."
3131
TERRAFORM="tflocal"
32+
33+
# Log Azure auth environment variables before unsetting
34+
echo "[DEBUG] Azure auth env vars before unsetting:"
35+
echo "[DEBUG] ARM_CLIENT_ID=${ARM_CLIENT_ID:-<not set>}"
36+
echo "[DEBUG] ARM_CLIENT_SECRET=${ARM_CLIENT_SECRET:+<set but hidden>}${ARM_CLIENT_SECRET:-<not set>}"
37+
echo "[DEBUG] ARM_TENANT_ID=${ARM_TENANT_ID:-<not set>}"
38+
echo "[DEBUG] ARM_SUBSCRIPTION_ID=${ARM_SUBSCRIPTION_ID:-<not set>}"
39+
echo "[DEBUG] AZURE_CLIENT_ID=${AZURE_CLIENT_ID:-<not set>}"
40+
echo "[DEBUG] AZURE_TENANT_ID=${AZURE_TENANT_ID:-<not set>}"
41+
42+
# Unset Azure auth environment variables to prevent interference from CI secrets
43+
unset ARM_CLIENT_ID ARM_CLIENT_SECRET ARM_TENANT_ID ARM_SUBSCRIPTION_ID
44+
unset AZURE_CLIENT_ID AZURE_CLIENT_SECRET AZURE_TENANT_ID AZURE_SUBSCRIPTION_ID
45+
46+
echo "[DEBUG] Azure auth env vars after unsetting: all cleared"
3247
AZ="azlocal"
3348
else
3449
echo "Using standard terraform and az for AzureCloud environment."
@@ -37,6 +52,7 @@ else
3752
fi
3853

3954
echo "[DEBUG] Cloud name: '$CLOUD_NAME', Environment: '$ENVIRONMENT', Tools: TERRAFORM=$TERRAFORM, AZ=$AZ"
55+
echo "[DEBUG] TERRAFORM command location: $(which $TERRAFORM 2>/dev/null || echo 'not found')"
4056

4157
echo "Initializing Terraform..."
4258
$TERRAFORM init -upgrade

samples/web-app-cosmosdb-mongodb-api/python/terraform/providers.tf

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,13 @@ provider "azurerm" {
1616
}
1717
}
1818

19-
# LocalStack Azure emulator uses a fixed subscription id
19+
# LocalStack Azure emulator configuration
2020
subscription_id = "00000000-0000-0000-0000-000000000000"
21+
tenant_id = "00000000-0000-0000-0000-000000000000"
22+
client_id = "00000000-0000-0000-0000-000000000000"
23+
client_secret = "fake-secret"
2124

22-
# The following configs are required for local testing
23-
# Skip provider registration and authentication for LocalStack
24-
resource_provider_registrations = "none"
25-
26-
# Use environment variables or static values for LocalStack
27-
tenant_id = "00000000-0000-0000-0000-000000000000"
28-
client_id = "00000000-0000-0000-0000-000000000000"
29-
client_secret = "fake-secret"
30-
31-
# Disable authentication checks
32-
#use_cli = false
33-
#use_msi = false
25+
# Disable CLI and MSI authentication
26+
use_cli = false
27+
use_msi = false
3428
}

samples/web-app-managed-identity/python/terraform/deploy.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,21 @@ fi
3030
if [[ $ENVIRONMENT == "LocalStack" ]]; then
3131
echo "Using tflocal and azlocal for LocalStack emulator environment."
3232
TERRAFORM="tflocal"
33+
34+
# Log Azure auth environment variables before unsetting
35+
echo "[DEBUG] Azure auth env vars before unsetting:"
36+
echo "[DEBUG] ARM_CLIENT_ID=${ARM_CLIENT_ID:-<not set>}"
37+
echo "[DEBUG] ARM_CLIENT_SECRET=${ARM_CLIENT_SECRET:+<set but hidden>}${ARM_CLIENT_SECRET:-<not set>}"
38+
echo "[DEBUG] ARM_TENANT_ID=${ARM_TENANT_ID:-<not set>}"
39+
echo "[DEBUG] ARM_SUBSCRIPTION_ID=${ARM_SUBSCRIPTION_ID:-<not set>}"
40+
echo "[DEBUG] AZURE_CLIENT_ID=${AZURE_CLIENT_ID:-<not set>}"
41+
echo "[DEBUG] AZURE_TENANT_ID=${AZURE_TENANT_ID:-<not set>}"
42+
43+
# Unset Azure auth environment variables to prevent interference from CI secrets
44+
unset ARM_CLIENT_ID ARM_CLIENT_SECRET ARM_TENANT_ID ARM_SUBSCRIPTION_ID
45+
unset AZURE_CLIENT_ID AZURE_CLIENT_SECRET AZURE_TENANT_ID AZURE_SUBSCRIPTION_ID
46+
47+
echo "[DEBUG] Azure auth env vars after unsetting: all cleared"
3348
AZ="azlocal"
3449
else
3550
echo "Using standard terraform and az for AzureCloud environment."
@@ -38,6 +53,7 @@ else
3853
fi
3954

4055
echo "[DEBUG] Cloud name: '$CLOUD_NAME', Environment: '$ENVIRONMENT', Tools: TERRAFORM=$TERRAFORM, AZ=$AZ"
56+
echo "[DEBUG] TERRAFORM command location: $(which $TERRAFORM 2>/dev/null || echo 'not found')"
4157

4258
echo "Initializing Terraform..."
4359
$TERRAFORM init -upgrade

samples/web-app-managed-identity/python/terraform/providers.tf

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,13 @@ provider "azurerm" {
1616
}
1717
}
1818

19-
# LocalStack Azure emulator uses a fixed subscription id
19+
# LocalStack Azure emulator configuration
2020
subscription_id = "00000000-0000-0000-0000-000000000000"
21+
tenant_id = "00000000-0000-0000-0000-000000000000"
22+
client_id = "00000000-0000-0000-0000-000000000000"
23+
client_secret = "fake-secret"
2124

22-
# The following configs are required for local testing
23-
# Skip provider registration and authentication for LocalStack
24-
resource_provider_registrations = "none"
25-
26-
# Use environment variables or static values for LocalStack
27-
tenant_id = "00000000-0000-0000-0000-000000000000"
28-
client_id = "00000000-0000-0000-0000-000000000000"
29-
client_secret = "fake-secret"
30-
31-
# Disable authentication checks
32-
#use_cli = false
33-
#use_msi = false
25+
# Disable CLI and MSI authentication
26+
use_cli = false
27+
use_msi = false
3428
}

samples/web-app-sql-database/python/terraform/deploy.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,21 @@ fi
3434
if [[ $ENVIRONMENT == "LocalStack" ]]; then
3535
echo "Using tflocal and azlocal for LocalStack emulator environment."
3636
TERRAFORM="tflocal"
37+
38+
# Log Azure auth environment variables before unsetting
39+
echo "[DEBUG] Azure auth env vars before unsetting:"
40+
echo "[DEBUG] ARM_CLIENT_ID=${ARM_CLIENT_ID:-<not set>}"
41+
echo "[DEBUG] ARM_CLIENT_SECRET=${ARM_CLIENT_SECRET:+<set but hidden>}${ARM_CLIENT_SECRET:-<not set>}"
42+
echo "[DEBUG] ARM_TENANT_ID=${ARM_TENANT_ID:-<not set>}"
43+
echo "[DEBUG] ARM_SUBSCRIPTION_ID=${ARM_SUBSCRIPTION_ID:-<not set>}"
44+
echo "[DEBUG] AZURE_CLIENT_ID=${AZURE_CLIENT_ID:-<not set>}"
45+
echo "[DEBUG] AZURE_TENANT_ID=${AZURE_TENANT_ID:-<not set>}"
46+
47+
# Unset Azure auth environment variables to prevent interference from CI secrets
48+
unset ARM_CLIENT_ID ARM_CLIENT_SECRET ARM_TENANT_ID ARM_SUBSCRIPTION_ID
49+
unset AZURE_CLIENT_ID AZURE_CLIENT_SECRET AZURE_TENANT_ID AZURE_SUBSCRIPTION_ID
50+
51+
echo "[DEBUG] Azure auth env vars after unsetting: all cleared"
3752
AZ="azlocal"
3853
else
3954
echo "Using standard terraform and az for AzureCloud environment."
@@ -42,6 +57,7 @@ else
4257
fi
4358

4459
echo "[DEBUG] Cloud name: '$CLOUD_NAME', Environment: '$ENVIRONMENT', Tools: TERRAFORM=$TERRAFORM, AZ=$AZ"
60+
echo "[DEBUG] TERRAFORM command location: $(which $TERRAFORM 2>/dev/null || echo 'not found')"
4561

4662
echo "Initializing Terraform..."
4763
$TERRAFORM init -upgrade

samples/web-app-sql-database/python/terraform/providers.tf

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,13 @@ provider "azurerm" {
1616
}
1717
}
1818

19-
# LocalStack Azure emulator uses a fixed subscription id
19+
# LocalStack Azure emulator configuration
2020
subscription_id = "00000000-0000-0000-0000-000000000000"
21+
tenant_id = "00000000-0000-0000-0000-000000000000"
22+
client_id = "00000000-0000-0000-0000-000000000000"
23+
client_secret = "fake-secret"
2124

22-
# The following configs are required for local testing
23-
# Skip provider registration and authentication for LocalStack
24-
resource_provider_registrations = "none"
25-
26-
# Use environment variables or static values for LocalStack
27-
tenant_id = "00000000-0000-0000-0000-000000000000"
28-
client_id = "00000000-0000-0000-0000-000000000000"
29-
client_secret = "fake-secret"
30-
31-
# Disable authentication checks
32-
#use_cli = false
33-
#use_msi = false
25+
# Disable CLI and MSI authentication
26+
use_cli = false
27+
use_msi = false
3428
}

0 commit comments

Comments
 (0)