Skip to content

Commit 7d5da83

Browse files
authored
Fixing app service settings (#986)
1 parent ff50774 commit 7d5da83

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

infra/core/host/appservice.bicep

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,18 @@ resource appService 'Microsoft.Web/sites@2022-03-01' = {
6565

6666
identity: { type: managedIdentity ? 'SystemAssigned' : 'None' }
6767

68+
resource configAppSettings 'config' = {
69+
name: 'appsettings'
70+
properties: union(appSettings,
71+
{
72+
SCM_DO_BUILD_DURING_DEPLOYMENT: string(scmDoBuildDuringDeployment)
73+
ENABLE_ORYX_BUILD: string(enableOryxBuild)
74+
},
75+
runtimeName == 'python' ? { PYTHON_ENABLE_GUNICORN_MULTIWORKERS: 'true'} : {},
76+
!empty(applicationInsightsName) ? { APPLICATIONINSIGHTS_CONNECTION_STRING: applicationInsights.properties.ConnectionString } : {},
77+
!empty(keyVaultName) ? { AZURE_KEY_VAULT_ENDPOINT: keyVault.properties.vaultUri } : {})
78+
}
79+
6880
resource configLogs 'config' = {
6981
name: 'logs'
7082
properties: {
@@ -73,6 +85,9 @@ resource appService 'Microsoft.Web/sites@2022-03-01' = {
7385
failedRequestsTracing: { enabled: true }
7486
httpLogs: { fileSystem: { enabled: true, retentionInDays: 1, retentionInMb: 35 } }
7587
}
88+
dependsOn: [
89+
configAppSettings
90+
]
7691
}
7792

7893
resource basicPublishingCredentialsPoliciesFtp 'basicPublishingCredentialsPolicies' = {
@@ -90,21 +105,6 @@ resource appService 'Microsoft.Web/sites@2022-03-01' = {
90105
}
91106
}
92107

93-
module config 'appservice-appsettings.bicep' = if (!empty(appSettings)) {
94-
name: '${name}-appSettings'
95-
params: {
96-
name: appService.name
97-
appSettings: union(appSettings,
98-
{
99-
SCM_DO_BUILD_DURING_DEPLOYMENT: string(scmDoBuildDuringDeployment)
100-
ENABLE_ORYX_BUILD: string(enableOryxBuild)
101-
},
102-
runtimeName == 'python' && appCommandLine == '' ? { PYTHON_ENABLE_GUNICORN_MULTIWORKERS: 'true'} : {},
103-
!empty(applicationInsightsName) ? { APPLICATIONINSIGHTS_CONNECTION_STRING: applicationInsights.properties.ConnectionString } : {},
104-
!empty(keyVaultName) ? { AZURE_KEY_VAULT_ENDPOINT: keyVault.properties.vaultUri } : {})
105-
}
106-
}
107-
108108
resource keyVault 'Microsoft.KeyVault/vaults@2022-07-01' existing = if (!(empty(keyVaultName))) {
109109
name: keyVaultName
110110
}

0 commit comments

Comments
 (0)