11# !/usr/bin/env pwsh
22
3- Write-Host " Starting postprovisioning..."
3+ Write-Host " --- ☑️ 1. Starting postprovisioning ---"
4+
5+ # -----------------------------------------------------------
6+ # Retrieve service names, resource group name, and other values from environment variables
47
58# Retrieve service names, resource group name, and other values from environment variables
69$resourceGroupName = $env: AZURE_RESOURCE_GROUP
@@ -23,25 +26,24 @@ Write-Host "azureSearchEndpoint: $azureSearchEndpoint"
2326
2427# Ensure all required environment variables are set
2528if ([string ]::IsNullOrEmpty($resourceGroupName ) -or [string ]::IsNullOrEmpty($openAiService ) -or [string ]::IsNullOrEmpty($subscriptionId )) {
26- Write-Host " One or more required environment variables are not set."
29+ Write-Host " 🅇 One or more required environment variables are not set."
2730 Write-Host " Ensure that AZURE_RESOURCE_GROUP, AZURE_OPENAI_NAME, AZURE_SUBSCRIPTION_ID are set."
2831 exit 1
2932}
3033
31- # Set additional environment variables expected by app
32- # --- Removed these since they are already set in azd env refresh ---
33- # azd env set AZURE_OPENAI_API_VERSION $AZURE_OPENAI_API_VERSION # 2023-03-15-preview
34- # azd env set AZURE_OPENAI_CHAT_DEPLOYMENT AZURE_OPENAI_API_VERSION # gpt-35-turbo
35- # azd env set AZURE_SEARCH_ENDPOINT $AZURE_SEARCH_ENDPOINT
36-
3734# Output environment variables to .env file using azd env get-values
3835azd env get-values > .env
39- Write-Host " Script execution completed successfully."
36+ # Write-Host "--- ✅ 2. Set environment variables ---"
37+
38+ # -----------------------------------------------------------
39+ # Setup to run notebooks
40+ # python -m pip install -r ./src/api/requirements.txt > $null
41+ # Write-Host "---- ✅ 3. Installed required dependencies ---"
4042
41- Write-Host ' Installing dependencies from "requirements.txt"'
42- python - m pip install - r ./ src/ api/ requirements.txt > $null
43+ # -----------------------------------------------------------
44+ # Run notebooks to populate data
45+ # jupyter nbconvert --execute --to python --ExecutePreprocessor.timeout=-1 data/customer_info/create-cosmos-db.ipynb > $null
46+ # jupyter nbconvert --execute --to python --ExecutePreprocessor.timeout=-1 data/product_info/create-azure-search.ipynb > $null
47+ # Write-Host "---- ✅ 4. Completed populating data ---"
4348
44- # populate data
45- Write-Host " Populating data ...."
46- jupyter nbconvert -- execute -- to python -- ExecutePreprocessor.timeout= -1 data / customer_info/ create- cosmos- db.ipynb > $null
47- jupyter nbconvert -- execute -- to python -- ExecutePreprocessor.timeout= -1 data / product_info/ create- azure- search.ipynb > $null
49+ Write-Host " --- ✅ Completed postprovisioning ---"
0 commit comments