11# yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-dev/main/schemas/v1.0/azure.yaml.json
2- name : byoc-research-assistant
2+ name : byoc-research-assistant-custom
33
44requiredVersions :
55 azd : " >= 1.18.0"
66
77metadata :
8- 8+ 9+
10+ infra :
11+ provider : bicep
12+ path : infra
13+ module : main
914
1015services :
1116 webapp :
@@ -25,6 +30,55 @@ services:
2530 run : bash ../infra/scripts/package_webapp.sh
2631 interactive : true
2732 continueOnError : false
33+ postdeploy :
34+ windows :
35+ shell : pwsh
36+ run : |
37+ Write-Host ""
38+ Write-Host "🔄 Configuring App Service for code deployment..."
39+ $rgName = (azd env get-value AZURE_RESOURCE_GROUP)
40+ if ($rgName) {
41+ $appName = (az webapp list --resource-group $rgName --query "[?kind=='app,linux'].name" -o tsv)
42+ if ($appName) {
43+ Write-Host " Found App Service: $appName in $rgName"
44+ Write-Host " Setting Python 3.11 runtime and startup command..."
45+ az webapp config set --resource-group $rgName --name $appName --linux-fx-version `"PYTHON`|3.11`" --startup-file "gunicorn --bind=0.0.0.0:8000 --timeout 600 app:app" --output none
46+ Write-Host " Restarting App Service..."
47+ az webapp restart --resource-group $rgName --name $appName --output none
48+ Write-Host " ✅ App Service configured and restarted"
49+ } else {
50+ Write-Host " ⚠️ Could not find App Service"
51+ }
52+ } else {
53+ Write-Host " ⚠️ Could not determine resource group"
54+ }
55+ Write-Host ""
56+ interactive : true
57+ continueOnError : true
58+ posix :
59+ shell : sh
60+ run : |
61+ echo ""
62+ echo "🔄 Configuring App Service for code deployment..."
63+ RG_NAME=$(azd env get-value AZURE_RESOURCE_GROUP)
64+ if [ ! -z "$RG_NAME" ]; then
65+ APP_NAME=$(az webapp list --resource-group "$RG_NAME" --query "[?kind=='app,linux'].name" -o tsv)
66+ if [ ! -z "$APP_NAME" ]; then
67+ echo " Found App Service: $APP_NAME in $RG_NAME"
68+ echo " Setting Python 3.11 runtime and startup command..."
69+ az webapp config set --resource-group "$RG_NAME" --name "$APP_NAME" --linux-fx-version "PYTHON|3.11" --startup-file "gunicorn --bind=0.0.0.0:8000 --timeout 600 app:app" --output none
70+ echo " Restarting App Service..."
71+ az webapp restart --resource-group "$RG_NAME" --name "$APP_NAME" --output none
72+ echo " ✅ App Service configured and restarted"
73+ else
74+ echo " ⚠️ Could not find App Service"
75+ fi
76+ else
77+ echo " ⚠️ Could not determine resource group"
78+ fi
79+ echo ""
80+ interactive : true
81+ continueOnError : true
2882
2983hooks :
3084 postprovision :
0 commit comments