Skip to content

Commit 720ef0b

Browse files
fix: Strip trailing carriage returns from variables to ensure compatibility on Windows
1 parent 8c7bb05 commit 720ef0b

4 files changed

Lines changed: 26 additions & 3 deletions

File tree

infra/main.bicep

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ param gpt5MiniModelCapacity int = 50
138138
param gptImageModelDeploymentType string = 'GlobalStandard'
139139

140140
@description('Optional. gpt-image-1.5 deployment capacity (RPM). Defaults to 5 to support concurrent marketing-image generation across multiple sessions.')
141-
param gptImageModelCapacity int = 5
141+
param gptImageModelCapacity int = 1
142142

143143
@description('Optional. The tags to apply to all deployed Azure resources.')
144144
param tags resourceInput<'Microsoft.Resources/resourceGroups@2025-04-01'>.tags = {}

infra/main_custom.bicep

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ param gpt4_1ModelCapacity int = 150
124124
param gptReasoningModelCapacity int = 100
125125

126126
@description('Optional. gpt-image-1.5 deployment capacity (RPM). Defaults to 5 to support concurrent marketing-image generation across multiple sessions.')
127-
param gptImageModelCapacity int = 5
127+
param gptImageModelCapacity int = 1
128128

129129
@description('Optional. The tags to apply to all deployed Azure resources.')
130130
param tags resourceInput<'Microsoft.Resources/resourceGroups@2025-04-01'>.tags = {}

infra/scripts/checkquota.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ SUBSCRIPTION_ID="${AZURE_SUBSCRIPTION_ID}"
77
GPT_MIN_CAPACITY="${GPT_MIN_CAPACITY}"
88
O4_MINI_MIN_CAPACITY="${O4_MINI_MIN_CAPACITY}"
99
GPT41_MINI_MIN_CAPACITY="${GPT41_MINI_MIN_CAPACITY}"
10-
GPT_IMAGE_MIN_CAPACITY="${GPT_IMAGE_MIN_CAPACITY:-4}"
10+
GPT_IMAGE_MIN_CAPACITY="${GPT_IMAGE_MIN_CAPACITY:-1}"
1111

1212
echo "🔄 Validating required environment variables..."
1313
if [[ -z "$SUBSCRIPTION_ID" || -z "$REGIONS" ]]; then

infra/scripts/post_deploy.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,13 @@ PY
462462

463463
local first_blob_container=""
464464
while IFS='|' read -r item_type container source pattern index_name; do
465+
# The temp file is written by Windows Python (CRLF), so the last field read
466+
# here may carry a trailing carriage return that corrupts the index URL.
467+
item_type="${item_type//$'\r'/}"
468+
container="${container//$'\r'/}"
469+
source="${source//$'\r'/}"
470+
pattern="${pattern//$'\r'/}"
471+
index_name="${index_name//$'\r'/}"
465472
case "$item_type" in
466473
BLOB_INDEX)
467474
if [ ! -d "$pack_path/$source" ]; then
@@ -679,6 +686,21 @@ main() {
679686
fi
680687
fi
681688

689+
# On Windows runners the resolved values come from Windows builds of az/azd
690+
# and Python, which emit CRLF line endings. A stray carriage return survives
691+
# command substitution and corrupts any URL built from these values (HTTP 400
692+
# "Bad Request - Invalid URL" from Azure Search/Storage). Strip CR defensively
693+
# so the script behaves identically on Linux and Windows.
694+
backend_url="${backend_url//$'\r'/}"
695+
storage_account="${storage_account//$'\r'/}"
696+
ai_search="${ai_search//$'\r'/}"
697+
ai_search_endpoint="${ai_search_endpoint//$'\r'/}"
698+
openai_endpoint="${openai_endpoint//$'\r'/}"
699+
project_endpoint="${project_endpoint//$'\r'/}"
700+
ai_foundry_resource_id="${ai_foundry_resource_id//$'\r'/}"
701+
ai_project_name="${ai_project_name//$'\r'/}"
702+
resource_group="${resource_group//$'\r'/}"
703+
682704
select_use_case
683705

684706
echo ""
@@ -709,6 +731,7 @@ main() {
709731
user_principal_id="$(az ad sp show --id "$AZURE_CLIENT_ID" --query id -o tsv 2>/dev/null || true)"
710732
fi
711733
fi
734+
user_principal_id="${user_principal_id//$'\r'/}"
712735
if [ -z "$user_principal_id" ]; then
713736
fatal "Could not retrieve signed-in user principal id. In CI, set USER_PRINCIPAL_ID or ensure AZURE_CLIENT_ID is exported and the SP is visible to Microsoft Graph."
714737
fi

0 commit comments

Comments
 (0)