|
462 | 462 |
|
463 | 463 | local first_blob_container="" |
464 | 464 | 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'/}" |
465 | 472 | case "$item_type" in |
466 | 473 | BLOB_INDEX) |
467 | 474 | if [ ! -d "$pack_path/$source" ]; then |
@@ -679,6 +686,21 @@ main() { |
679 | 686 | fi |
680 | 687 | fi |
681 | 688 |
|
| 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 | + |
682 | 704 | select_use_case |
683 | 705 |
|
684 | 706 | echo "" |
@@ -709,6 +731,7 @@ main() { |
709 | 731 | user_principal_id="$(az ad sp show --id "$AZURE_CLIENT_ID" --query id -o tsv 2>/dev/null || true)" |
710 | 732 | fi |
711 | 733 | fi |
| 734 | + user_principal_id="${user_principal_id//$'\r'/}" |
712 | 735 | if [ -z "$user_principal_id" ]; then |
713 | 736 | 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." |
714 | 737 | fi |
|
0 commit comments