2424
2525Set-StrictMode - Version Latest
2626$ErrorActionPreference = " Stop"
27+ $script :hasErrors = $false
2728
2829# ──────────────────────────────────────────────────────────────────────────────
2930# Helper functions
@@ -394,7 +395,8 @@ $env:COSMOSDB_CONTAINER = $cosmosContainer
394395
395396$seedTeamsScript | & $pythonCmd -
396397if ($LASTEXITCODE -ne 0 ) {
397- Write-Host " WARNING: Team config seeding had errors." - ForegroundColor Yellow
398+ Write-Host " ERROR: Team config seeding had errors." - ForegroundColor Red
399+ $script :hasErrors = $true
398400}
399401
400402# ──────────────────────────────────────────────────────────────────────────────
@@ -427,6 +429,7 @@ if ($selectedDataPacks.Count -gt 0) {
427429 $result = Deploy-ContentPack - PackPath $packPath - StorageAccountName $storageAccount - AiSearchName $aiSearchName - PythonCmd $pythonCmd
428430 if (-not $result ) {
429431 $isSampleDataFailed = $true
432+ $script :hasErrors = $true
430433 Write-Host " Error in data deployment for $packPath " - ForegroundColor Red
431434 }
432435 }
@@ -440,7 +443,8 @@ if ($selectedDataPacks.Count -gt 0) {
440443 $env: AZURE_AI_PROJECT_ENDPOINT = $projectEndpoint
441444 $process = Start-Process - FilePath $pythonCmd - ArgumentList " infra/scripts/seed_vector_stores.py" - Wait - NoNewWindow - PassThru
442445 if ($process.ExitCode -ne 0 ) {
443- Write-Host " WARNING: Vector store creation failed. Run 'python infra/scripts/seed_vector_stores.py' manually." - ForegroundColor Yellow
446+ Write-Host " ERROR: Vector store creation failed. Run 'python infra/scripts/seed_vector_stores.py' manually." - ForegroundColor Red
447+ $script :hasErrors = $true
444448 } else {
445449 Write-Host " Vector stores created successfully."
446450 }
@@ -455,7 +459,8 @@ if ($selectedDataPacks.Count -gt 0) {
455459 $env: AZURE_OPENAI_ENDPOINT = $openaiEndpoint
456460 $process = Start-Process - FilePath $pythonCmd - ArgumentList " infra/scripts/seed_knowledge_bases.py" - Wait - NoNewWindow - PassThru
457461 if ($process.ExitCode -ne 0 ) {
458- Write-Host " WARNING: Knowledge base seeding failed. Run 'python infra/scripts/seed_knowledge_bases.py' manually." - ForegroundColor Yellow
462+ Write-Host " ERROR: Knowledge base seeding failed. Run 'python infra/scripts/seed_knowledge_bases.py' manually." - ForegroundColor Red
463+ $script :hasErrors = $true
459464 } else {
460465 Write-Host " Knowledge bases seeded successfully."
461466 }
@@ -467,12 +472,25 @@ if ($selectedDataPacks.Count -gt 0) {
467472# Done
468473# ──────────────────────────────────────────────────────────────────────────────
469474
470- Write-Host " `n ========================================" - ForegroundColor Green
471- Write-Host " Post-deployment data seeding complete!" - ForegroundColor Green
472- Write-Host " ========================================" - ForegroundColor Green
473- Write-Host " `n The application is ready to use."
474- $frontendHost = $ (azd env get-value webSiteDefaultHostname 2> $null )
475- if ($frontendHost ) {
476- Write-Host " Frontend: https://$frontendHost "
475+ if ($script :hasErrors ) {
476+ Write-Host " `n ========================================" - ForegroundColor Red
477+ Write-Host " Post-deployment seeding completed with ERRORS" - ForegroundColor Red
478+ Write-Host " ========================================" - ForegroundColor Red
479+ Write-Host " `n One or more steps failed. Review the output above and re-run the failed steps manually." - ForegroundColor Yellow
480+ $frontendHost = $ (azd env get-value webSiteDefaultHostname 2> $null )
481+ if ($frontendHost ) {
482+ Write-Host " Frontend: https://$frontendHost "
483+ }
484+ Write-Host " "
485+ exit 1
486+ } else {
487+ Write-Host " `n ========================================" - ForegroundColor Green
488+ Write-Host " Post-deployment data seeding complete!" - ForegroundColor Green
489+ Write-Host " ========================================" - ForegroundColor Green
490+ Write-Host " `n The application is ready to use."
491+ $frontendHost = $ (azd env get-value webSiteDefaultHostname 2> $null )
492+ if ($frontendHost ) {
493+ Write-Host " Frontend: https://$frontendHost "
494+ }
495+ Write-Host " "
477496}
478- Write-Host " "
0 commit comments