@@ -30,62 +30,13 @@ services:
3030 run : bash ../infra/scripts/package_webapp.sh
3131 interactive : true
3232 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
8233
8334hooks :
8435 postprovision :
8536 windows :
8637 run : |
8738 Write-Host "✅ Infrastructure provisioned successfully!"
88- $webAppUrl = azd env get-value WEB_APP_URL
39+ $webAppUrl = ( azd env get-value WEB_APP_URL)
8940 if ($webAppUrl) {
9041 Write-Host "Web app URL: $webAppUrl"
9142 }
0 commit comments