@@ -10,9 +10,6 @@ param location string = resourceGroup().location
1010@secure ()
1111param secretKey string = ''
1212
13- @description ('Database URL for the application' )
14- param databaseUrl string = ''
15-
1613// Generate unique resource token
1714var resourceToken = uniqueString (subscription ().id , resourceGroup ().id , location , environmentName )
1815
@@ -61,16 +58,18 @@ resource appService 'Microsoft.Web/sites@2024-04-01' = {
6158 reserved : true
6259 httpsOnly : true
6360 siteConfig : {
64- linuxFxVersion : 'PYTHON|3.12'
65- appCommandLine : 'gunicorn --bind=0.0.0.0 --timeout 600 --access-logfile \' -\' --error-logfile \' -\' main:app'
61+ linuxFxVersion : 'PYTHON|3.11'
62+ alwaysOn : true
63+ ftpsState : 'FtpsOnly'
64+ appCommandLine : 'python -m uvicorn main:app --host 0.0.0.0 --port 8000'
6665 appSettings : [
6766 {
6867 name : 'SECRET_KEY'
6968 value : secretKey
7069 }
7170 {
72- name : 'DATABASE_URL '
73- value : databaseUrl
71+ name : 'WEBSITES_PORT '
72+ value : '8000'
7473 }
7574 {
7675 name : 'SCM_DO_BUILD_DURING_DEPLOYMENT'
@@ -80,12 +79,15 @@ resource appService 'Microsoft.Web/sites@2024-04-01' = {
8079 name : 'ENABLE_ORYX_BUILD'
8180 value : 'true'
8281 }
82+ {
83+ name : 'PYTHONPATH'
84+ value : '/home/site/wwwroot'
85+ }
8386 ]
8487 cors : {
8588 allowedOrigins : ['*' ]
8689 supportCredentials : false
8790 }
88- alwaysOn : false
8991 healthCheckPath : '/health'
9092 }
9193 }
@@ -94,6 +96,8 @@ resource appService 'Microsoft.Web/sites@2024-04-01' = {
9496// Outputs
9597output RESOURCE_GROUP_ID string = resourceGroup ().id
9698output AZURE_LOCATION string = location
99+ output AZURE_TENANT_ID string = tenant ().tenantId
100+ output AZURE_RESOURCE_GROUP string = resourceGroup ().name
101+ output SERVICE_WEB_NAME string = appService .name
102+ output SERVICE_WEB_URI string = 'https://${appService .properties .defaultHostName }'
97103output SERVICE_TODO_APP_IDENTITY_PRINCIPAL_ID string = appService .identity .principalId
98- output SERVICE_TODO_APP_NAME string = appService .name
99- output SERVICE_TODO_APP_URI string = 'https://${appService .properties .defaultHostName }'
0 commit comments