@@ -119,10 +119,11 @@ if ($ResourceGroup) {
119119}
120120
121121# Upload CSV files
122- Write-Host " Uploading CSV files to blob storage..."
122+ Write-Host " Uploading CSV and JSON files to blob storage..."
123123az storage blob upload- batch -- account- name $StorageAccount -- destination $BlobContainer -- source " data/datasets" -- auth- mode login -- pattern " *.csv" -- overwrite -- output none
124- if ($LASTEXITCODE -ne 0 ) { Write-Host " Error: Failed to upload CSV files." ; exit 1 }
125- Write-Host " CSV files uploaded successfully."
124+ az storage blob upload- batch -- account- name $StorageAccount -- destination $BlobContainer -- source " data/datasets" -- auth- mode login -- pattern " *.json" -- overwrite -- output none
125+ if ($LASTEXITCODE -ne 0 ) { Write-Host " Error: Failed to upload CSV and JSON files." ; exit 1 }
126+ Write-Host " CSV and JSON files uploaded successfully."
126127
127128# Upload PDF files
128129Write-Host " Uploading PDF files from RFP_dataset to blob storage..."
@@ -180,21 +181,29 @@ Write-Host "Installing requirements"
180181pip install -- quiet - r infra/ scripts/ requirements.txt
181182Write-Host " Requirements installed"
182183
183- # Run indexing scripts
184- if ($hasCsv ) {
185- Write-Host " Running the python script to index CSV data"
186- & $pythonCmd " infra/scripts/index_datasets.py" $StorageAccount $BlobContainer $AiSearch $AiSearchIndex
187- if ($LASTEXITCODE -ne 0 ) { Write-Host " Error: CSV indexing script failed." ; exit 1 }
188- }
189- if ($hasPdf ) {
190- Write-Host " Running the python script to index PDF data"
191- & $pythonCmd " infra/scripts/index_rfp_data.py" $StorageAccount $BlobContainer $AiSearch $AiSearchIndex
192- if ($LASTEXITCODE -ne 0 ) { Write-Host " Error: PDF indexing script failed." ; exit 1 }
193- }
194- if (-not $hasCsv -and -not $hasPdf ) {
195- Write-Host " No CSV or PDF files found to index."
184+ Write-Host " Running the python script to index data"
185+ $process = Start-Process - FilePath $pythonCmd - ArgumentList " infra/scripts/index_datasets.py" , $StorageAccount , $BlobContainer , $AiSearch , $AiSearchIndex - Wait - NoNewWindow - PassThru
186+
187+ if ($process.ExitCode -ne 0 ) {
188+ Write-Host " Error: Indexing python script execution failed."
189+ exit 1
196190}
197191
192+ # Run indexing scripts
193+ # if ($hasCsv) {
194+ # Write-Host "Running the python script to index CSV data"
195+ # & $pythonCmd "infra/scripts/index_datasets.py" $StorageAccount $BlobContainer $AiSearch $AiSearchIndex
196+ # if ($LASTEXITCODE -ne 0) { Write-Host "Error: CSV indexing script failed."; exit 1 }
197+ # }
198+ # if ($hasPdf) {
199+ # Write-Host "Running the python script to index PDF data"
200+ # & $pythonCmd "infra/scripts/index_rfp_data.py" $StorageAccount $BlobContainer $AiSearch $AiSearchIndex
201+ # if ($LASTEXITCODE -ne 0) { Write-Host "Error: PDF indexing script failed."; exit 1 }
202+ # }
203+ # if (-not $hasCsv -and -not $hasPdf) {
204+ # Write-Host "No CSV or PDF files found to index."
205+ # }
206+
198207# Disable public access again
199208if ($stIsPublicAccessDisabled ) {
200209 Write-Host " Disabling public access for storage account: $StorageAccount "
0 commit comments