Skip to content

Commit 3f5b4e4

Browse files
UpdatedCode
1 parent 7129ebb commit 3f5b4e4

File tree

2 files changed

+4
-52
lines changed

2 files changed

+4
-52
lines changed

azure_custom.yaml

Lines changed: 1 addition & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -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

8334
hooks:
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
}

infra/main_custom.bicep

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,10 +1043,11 @@ module webSite 'modules/web-sites.bicep' = {
10431043
}
10441044
tags: union(tags, { 'azd-service-name': 'webapp' })
10451045
location: location
1046-
kind: 'app,linux,container'
1046+
kind: 'app,linux'
10471047
serverFarmResourceId: webServerFarm.?outputs.resourceId
10481048
siteConfig: {
1049-
linuxFxVersion: 'DOCKER|${containerRegistryHostname}/${containerImageName}:${containerImageTag}'
1049+
linuxFxVersion: 'PYTHON|3.11'
1050+
appCommandLine: 'gunicorn --bind=0.0.0.0:8000 --timeout 600 app:app'
10501051
minTlsVersion: '1.2'
10511052
}
10521053
configs: [

0 commit comments

Comments
 (0)