diff --git a/templates/todo/common/infra/bicep/app/website-config.bicep b/templates/todo/common/infra/bicep/app/website-config.bicep deleted file mode 100644 index 3c0e70a66ee..00000000000 --- a/templates/todo/common/infra/bicep/app/website-config.bicep +++ /dev/null @@ -1,21 +0,0 @@ -@description('Resource name for backend Web App or Function App') -param apiAppName string = '' - -@description('Resource name to uniquely identify this API within the API Management service instance') -@minLength(1) -param apiName string - -@description('Resource ID for the existing apim service') -param apimServiceId string - -var appNameForBicep = !empty(apiAppName) ? apiAppName : 'placeholderName' - -resource apiAppProperties 'Microsoft.Web/sites/config@2022-03-01' = if (!empty(apiAppName)) { - name: '${appNameForBicep}/web' - kind: 'string' - properties: { - apiManagementConfig: { - id: '${apimServiceId}/apis/${apiName}' - } - } -} diff --git a/templates/todo/projects/csharp-cosmos-sql/.repo/bicep/infra/main.bicep b/templates/todo/projects/csharp-cosmos-sql/.repo/bicep/infra/main.bicep index 3eb64886058..4ab9043daa9 100644 --- a/templates/todo/projects/csharp-cosmos-sql/.repo/bicep/infra/main.bicep +++ b/templates/todo/projects/csharp-cosmos-sql/.repo/bicep/infra/main.bicep @@ -44,6 +44,7 @@ var actualDatabaseName = !empty(cosmosDatabaseName) ? cosmosDatabaseName : 'Todo var webUri = 'https://${web.outputs.defaultHostname}' var apiUri = 'https://${api.outputs.defaultHostname}' var apimApiUri = 'https://${apim.outputs.name}.azure-api.net/todo' +var apimServiceId = useAPIM ? apim.outputs.resourceId : '' // Organize resources in a resource group resource rg 'Microsoft.Resources/resourceGroups@2021-04-01' = { @@ -53,7 +54,7 @@ resource rg 'Microsoft.Resources/resourceGroups@2021-04-01' = { } // The application frontend -module web 'br/public:avm/res/web/site:0.3.4' = { +module web 'br/public:avm/res/web/site:0.3.9' = { name: 'web' scope: rg params: { @@ -68,11 +69,17 @@ module web 'br/public:avm/res/web/site:0.3.4' = { linuxFxVersion: 'node|20-lts' alwaysOn: true } + logsConfiguration: { + applicationLogs: { fileSystem: { level: 'Verbose' } } + detailedErrorMessages: { enabled: true } + failedRequestsTracing: { enabled: true } + httpLogs: { fileSystem: { enabled: true, retentionInDays: 1, retentionInMb: 35 } } + } } } // The application backend -module api 'br/public:avm/res/web/site:0.3.4' = { +module api 'br/public:avm/res/web/site:0.3.9' = { name: 'api' scope: rg params: { @@ -102,6 +109,12 @@ module api 'br/public:avm/res/web/site:0.3.4' = { SCM_DO_BUILD_DURING_DEPLOYMENT: 'False' ENABLE_ORYX_BUILD: 'True' } + logsConfiguration: { + applicationLogs: { fileSystem: { level: 'Verbose' } } + detailedErrorMessages: { enabled: true } + failedRequestsTracing: { enabled: true } + httpLogs: { fileSystem: { enabled: true, retentionInDays: 1, retentionInMb: 35 } } + } } } @@ -336,13 +349,19 @@ module apim 'br/public:avm/res/api-management/service:0.2.0' = if (useAPIM) { } //Configures the API settings for an api app within the Azure API Management (APIM) service. -module apiConfig '../../../../../common/infra/bicep/app/website-config.bicep' = if (useAPIM) { +module apiConfig 'br/public:avm/res/web/site:0.3.9' = if (useAPIM) { name: 'apiconfig' scope: rg params: { - apimServiceId: useAPIM ? apim.outputs.resourceId : '' - apiName: apimApiName - apiAppName: api.outputs.name + kind: 'app' + name: api.outputs.name + serverFarmResourceId: appServicePlan.outputs.resourceId + location: location + apiManagementConfiguration: { + apiManagementConfig: { + id: '${apimServiceId}/apis/${apimApiName}' + } + } } } diff --git a/templates/todo/projects/csharp-cosmos-sql/.repo/bicep/repo.yaml b/templates/todo/projects/csharp-cosmos-sql/.repo/bicep/repo.yaml index 09c50707958..017054e98fe 100644 --- a/templates/todo/projects/csharp-cosmos-sql/.repo/bicep/repo.yaml +++ b/templates/todo/projects/csharp-cosmos-sql/.repo/bicep/repo.yaml @@ -118,9 +118,6 @@ repo: - from: ../../../../common/infra/bicep/app/applicationinsights-dashboard.bicep to: ./infra/app/applicationinsights-dashboard.bicep - - from: ../../../../common/infra/bicep/app/website-config.bicep - to: ./infra/app/website-config.bicep - - from: ./../../ to: ./ ignore: diff --git a/templates/todo/projects/csharp-sql-swa-func/.repo/bicep/infra/main.bicep b/templates/todo/projects/csharp-sql-swa-func/.repo/bicep/infra/main.bicep index a647be3f171..2da0336660b 100644 --- a/templates/todo/projects/csharp-sql-swa-func/.repo/bicep/infra/main.bicep +++ b/templates/todo/projects/csharp-sql-swa-func/.repo/bicep/infra/main.bicep @@ -56,6 +56,7 @@ var actualDatabaseName = !empty(sqlDatabaseName) ? sqlDatabaseName : defaultData var webUri = 'https://${web.outputs.defaultHostname}' var apiUri = 'https://${api.outputs.defaultHostname}' var apimApiUri = 'https://${apim.outputs.name}.azure-api.net/todo' +var apimServiceId = useAPIM ? apim.outputs.resourceId : '' // Organize resources in a resource group resource rg 'Microsoft.Resources/resourceGroups@2021-04-01' = { @@ -77,7 +78,7 @@ module web 'br/public:avm/res/web/static-site:0.3.0' = { } // The application backend -module api 'br/public:avm/res/web/site:0.3.4' = { +module api 'br/public:avm/res/web/site:0.3.9' = { name: 'api' scope: rg params: { @@ -107,6 +108,12 @@ module api 'br/public:avm/res/web/site:0.3.4' = { SCM_DO_BUILD_DURING_DEPLOYMENT: 'False' ENABLE_ORYX_BUILD: 'True' } + logsConfiguration: { + applicationLogs: { fileSystem: { level: 'Verbose' } } + detailedErrorMessages: { enabled: true } + failedRequestsTracing: { enabled: true } + httpLogs: { fileSystem: { enabled: true, retentionInDays: 1, retentionInMb: 35 } } + } storageAccountResourceId: storage.outputs.resourceId } } @@ -355,13 +362,19 @@ module apim 'br/public:avm/res/api-management/service:0.2.0' = if (useAPIM) { } //Configures the API settings for an api app within the Azure API Management (APIM) service. -module apiConfig '../../../../../common/infra/bicep/app/website-config.bicep' = if (useAPIM) { +module apiConfig 'br/public:avm/res/web/site:0.3.9' = if (useAPIM) { name: 'apiconfig' scope: rg params: { - apimServiceId: useAPIM ? apim.outputs.resourceId : '' - apiName: apimApiName - apiAppName: api.outputs.name + kind: 'app' + name: api.outputs.name + serverFarmResourceId: appServicePlan.outputs.resourceId + location: location + apiManagementConfiguration: { + apiManagementConfig: { + id: '${apimServiceId}/apis/${apimApiName}' + } + } } } diff --git a/templates/todo/projects/csharp-sql-swa-func/.repo/bicep/repo.yaml b/templates/todo/projects/csharp-sql-swa-func/.repo/bicep/repo.yaml index 13aea658a7c..06a724c23f9 100644 --- a/templates/todo/projects/csharp-sql-swa-func/.repo/bicep/repo.yaml +++ b/templates/todo/projects/csharp-sql-swa-func/.repo/bicep/repo.yaml @@ -118,9 +118,6 @@ repo: - from: ../../../../common/infra/bicep/app/applicationinsights-dashboard.bicep to: ./infra/app/applicationinsights-dashboard.bicep - - from: ../../../../common/infra/bicep/app/website-config.bicep - to: ./infra/app/website-config.bicep - - from: ../../../../common/infra/bicep/app/sql-deployment-script.bicep to: ./infra/app/sql-deployment-script.bicep diff --git a/templates/todo/projects/csharp-sql/.repo/bicep/infra/main.bicep b/templates/todo/projects/csharp-sql/.repo/bicep/infra/main.bicep index e4ce65e99cf..14dac957e13 100644 --- a/templates/todo/projects/csharp-sql/.repo/bicep/infra/main.bicep +++ b/templates/todo/projects/csharp-sql/.repo/bicep/infra/main.bicep @@ -54,6 +54,7 @@ var actualDatabaseName = !empty(sqlDatabaseName) ? sqlDatabaseName : defaultData var webUri = 'https://${web.outputs.defaultHostname}' var apiUri = 'https://${api.outputs.defaultHostname}' var apimApiUri = 'https://${apim.outputs.name}.azure-api.net/todo' +var apimServiceId = useAPIM ? apim.outputs.resourceId : '' // Organize resources in a resource group resource rg 'Microsoft.Resources/resourceGroups@2021-04-01' = { @@ -63,7 +64,7 @@ resource rg 'Microsoft.Resources/resourceGroups@2021-04-01' = { } // The application frontend -module web 'br/public:avm/res/web/site:0.3.2' = { +module web 'br/public:avm/res/web/site:0.3.9' = { name: 'web' scope: rg params: { @@ -78,11 +79,17 @@ module web 'br/public:avm/res/web/site:0.3.2' = { linuxFxVersion: 'node|20-lts' alwaysOn: true } + logsConfiguration: { + applicationLogs: { fileSystem: { level: 'Verbose' } } + detailedErrorMessages: { enabled: true } + failedRequestsTracing: { enabled: true } + httpLogs: { fileSystem: { enabled: true, retentionInDays: 1, retentionInMb: 35 } } + } } } // The application backend -module api 'br/public:avm/res/web/site:0.2.0' = { +module api 'br/public:avm/res/web/site:0.3.9' = { name: 'api' scope: rg params: { @@ -109,6 +116,12 @@ module api 'br/public:avm/res/web/site:0.2.0' = { SCM_DO_BUILD_DURING_DEPLOYMENT: 'False' ENABLE_ORYX_BUILD: 'True' } + logsConfiguration: { + applicationLogs: { fileSystem: { level: 'Verbose' } } + detailedErrorMessages: { enabled: true } + failedRequestsTracing: { enabled: true } + httpLogs: { fileSystem: { enabled: true, retentionInDays: 1, retentionInMb: 35 } } + } } } @@ -338,13 +351,19 @@ module apim 'br/public:avm/res/api-management/service:0.2.0' = if (useAPIM) { } //Configures the API settings for an api app within the Azure API Management (APIM) service. -module apiConfig '../../../../../common/infra/bicep/app/website-config.bicep' = if (useAPIM) { +module apiConfig 'br/public:avm/res/web/site:0.3.9' = if (useAPIM) { name: 'apiconfig' scope: rg params: { - apimServiceId: useAPIM ? apim.outputs.resourceId : '' - apiName: apimApiName - apiAppName: api.outputs.name + kind: 'app' + name: api.outputs.name + serverFarmResourceId: appServicePlan.outputs.resourceId + location: location + apiManagementConfiguration: { + apiManagementConfig: { + id: '${apimServiceId}/apis/${apimApiName}' + } + } } } diff --git a/templates/todo/projects/csharp-sql/.repo/bicep/repo.yaml b/templates/todo/projects/csharp-sql/.repo/bicep/repo.yaml index ef5ca0d314f..8fb4748118c 100644 --- a/templates/todo/projects/csharp-sql/.repo/bicep/repo.yaml +++ b/templates/todo/projects/csharp-sql/.repo/bicep/repo.yaml @@ -119,9 +119,6 @@ repo: - from: ../../../../common/infra/bicep/app/applicationinsights-dashboard.bicep to: ./infra/app/applicationinsights-dashboard.bicep - - from: ../../../../common/infra/bicep/app/website-config.bicep - to: ./infra/app/website-config.bicep - - from: ../../../../common/infra/bicep/app/sql-deployment-script.bicep to: ./infra/app/sql-deployment-script.bicep diff --git a/templates/todo/projects/java-mongo-aca/.repo/bicep/infra/main.bicep b/templates/todo/projects/java-mongo-aca/.repo/bicep/infra/main.bicep index 52c9ce32f57..c66179b9b63 100644 --- a/templates/todo/projects/java-mongo-aca/.repo/bicep/infra/main.bicep +++ b/templates/todo/projects/java-mongo-aca/.repo/bicep/infra/main.bicep @@ -412,16 +412,6 @@ module apim 'br/public:avm/res/api-management/service:0.2.0' = if (useAPIM) { } } -//Configures the API settings for an api app within the Azure API Management (APIM) service. -module apiConfig '../../../../../common/infra/bicep/app/website-config.bicep' = if (useAPIM) { - name: 'apiconfig' - scope: rg - params: { - apimServiceId: useAPIM ? apim.outputs.resourceId : '' - apiName: apimApiName - } -} - // Data outputs output AZURE_COSMOS_CONNECTION_STRING_KEY string = connectionStringKey output AZURE_COSMOS_DATABASE_NAME string = actualDatabaseName diff --git a/templates/todo/projects/java-mongo-aca/.repo/bicep/repo.yaml b/templates/todo/projects/java-mongo-aca/.repo/bicep/repo.yaml index 9a0674b9461..bd6641c6225 100644 --- a/templates/todo/projects/java-mongo-aca/.repo/bicep/repo.yaml +++ b/templates/todo/projects/java-mongo-aca/.repo/bicep/repo.yaml @@ -122,9 +122,6 @@ repo: - from: ../../../../common/infra/bicep/app/applicationinsights-dashboard.bicep to: ./infra/app/applicationinsights-dashboard.bicep - - from: ../../../../common/infra/bicep/app/website-config.bicep - to: ./infra/app/website-config.bicep - - from: ./../../ to: ./ ignore: diff --git a/templates/todo/projects/java-mongo/.repo/bicep/infra/main.bicep b/templates/todo/projects/java-mongo/.repo/bicep/infra/main.bicep index f0ff126481b..46d53840422 100644 --- a/templates/todo/projects/java-mongo/.repo/bicep/infra/main.bicep +++ b/templates/todo/projects/java-mongo/.repo/bicep/infra/main.bicep @@ -79,6 +79,7 @@ var actualDatabaseName = !empty(cosmosDatabaseName) ? cosmosDatabaseName : defau var webUri = 'https://${web.outputs.defaultHostname}' var apiUri = 'https://${api.outputs.defaultHostname}' var apimApiUri = 'https://${apim.outputs.name}.azure-api.net/todo' +var apimServiceId = useAPIM ? apim.outputs.resourceId : '' // Organize resources in a resource group resource rg 'Microsoft.Resources/resourceGroups@2021-04-01' = { @@ -88,7 +89,7 @@ resource rg 'Microsoft.Resources/resourceGroups@2021-04-01' = { } // The application frontend -module web 'br/public:avm/res/web/site:0.2.0' = { +module web 'br/public:avm/res/web/site:0.3.9' = { name: 'web' scope: rg params: { @@ -103,11 +104,17 @@ module web 'br/public:avm/res/web/site:0.2.0' = { linuxFxVersion: 'node|20-lts' alwaysOn: true } + logsConfiguration: { + applicationLogs: { fileSystem: { level: 'Verbose' } } + detailedErrorMessages: { enabled: true } + failedRequestsTracing: { enabled: true } + httpLogs: { fileSystem: { enabled: true, retentionInDays: 1, retentionInMb: 35 } } + } } } // The application backend -module api 'br/public:avm/res/web/site:0.2.0' = { +module api 'br/public:avm/res/web/site:0.3.9' = { name: 'api' scope: rg params: { @@ -142,6 +149,12 @@ module api 'br/public:avm/res/web/site:0.2.0' = { ['-Djdk.attach.allowAttachSelf=true']), ' ') } + logsConfiguration: { + applicationLogs: { fileSystem: { level: 'Verbose' } } + detailedErrorMessages: { enabled: true } + failedRequestsTracing: { enabled: true } + httpLogs: { fileSystem: { enabled: true, retentionInDays: 1, retentionInMb: 35 } } + } } } @@ -344,13 +357,19 @@ module apim 'br/public:avm/res/api-management/service:0.2.0' = if (useAPIM) { } //Configures the API settings for an api app within the Azure API Management (APIM) service. -module apiConfig '../../../../../common/infra/bicep/app/website-config.bicep' = if (useAPIM) { +module apiConfig 'br/public:avm/res/web/site:0.3.9' = if (useAPIM) { name: 'apiconfig' scope: rg params: { - apimServiceId: useAPIM ? apim.outputs.resourceId : '' - apiName: apimApiName - apiAppName: api.outputs.name + kind: 'app' + name: api.outputs.name + serverFarmResourceId: appServicePlan.outputs.resourceId + location: location + apiManagementConfiguration: { + apiManagementConfig: { + id: '${apimServiceId}/apis/${apimApiName}' + } + } } } diff --git a/templates/todo/projects/java-mongo/.repo/bicep/repo.yaml b/templates/todo/projects/java-mongo/.repo/bicep/repo.yaml index f062acd6657..444e80425b0 100644 --- a/templates/todo/projects/java-mongo/.repo/bicep/repo.yaml +++ b/templates/todo/projects/java-mongo/.repo/bicep/repo.yaml @@ -115,9 +115,6 @@ repo: - from: ../../../../common/infra/bicep/app/applicationinsights-dashboard.bicep to: ./infra/app/applicationinsights-dashboard.bicep - - from: ../../../../common/infra/bicep/app/website-config.bicep - to: ./infra/app/website-config.bicep - - from: ./../../ to: ./ ignore: diff --git a/templates/todo/projects/nodejs-mongo-aca/.repo/bicep/infra/main.bicep b/templates/todo/projects/nodejs-mongo-aca/.repo/bicep/infra/main.bicep index 52c9ce32f57..c66179b9b63 100644 --- a/templates/todo/projects/nodejs-mongo-aca/.repo/bicep/infra/main.bicep +++ b/templates/todo/projects/nodejs-mongo-aca/.repo/bicep/infra/main.bicep @@ -412,16 +412,6 @@ module apim 'br/public:avm/res/api-management/service:0.2.0' = if (useAPIM) { } } -//Configures the API settings for an api app within the Azure API Management (APIM) service. -module apiConfig '../../../../../common/infra/bicep/app/website-config.bicep' = if (useAPIM) { - name: 'apiconfig' - scope: rg - params: { - apimServiceId: useAPIM ? apim.outputs.resourceId : '' - apiName: apimApiName - } -} - // Data outputs output AZURE_COSMOS_CONNECTION_STRING_KEY string = connectionStringKey output AZURE_COSMOS_DATABASE_NAME string = actualDatabaseName diff --git a/templates/todo/projects/nodejs-mongo-aca/.repo/bicep/repo.yaml b/templates/todo/projects/nodejs-mongo-aca/.repo/bicep/repo.yaml index c36c2f513f9..36f0ab02012 100644 --- a/templates/todo/projects/nodejs-mongo-aca/.repo/bicep/repo.yaml +++ b/templates/todo/projects/nodejs-mongo-aca/.repo/bicep/repo.yaml @@ -125,9 +125,6 @@ repo: - from: ../../../../common/infra/bicep/app/applicationinsights-dashboard.bicep to: ./infra/app/applicationinsights-dashboard.bicep - - from: ../../../../common/infra/bicep/app/website-config.bicep - to: ./infra/app/website-config.bicep - - from: ./../../ to: ./ ignore: diff --git a/templates/todo/projects/nodejs-mongo-swa-func/.repo/bicep/infra/main.bicep b/templates/todo/projects/nodejs-mongo-swa-func/.repo/bicep/infra/main.bicep index 22ab294a987..7d127622a72 100644 --- a/templates/todo/projects/nodejs-mongo-swa-func/.repo/bicep/infra/main.bicep +++ b/templates/todo/projects/nodejs-mongo-swa-func/.repo/bicep/infra/main.bicep @@ -80,6 +80,7 @@ var actualDatabaseName = !empty(cosmosDatabaseName) ? cosmosDatabaseName : defau var apiUri = 'https://${api.outputs.defaultHostname}' var webUri = 'https://${web.outputs.defaultHostname}' var apimApiUri = 'https://${apim.outputs.name}.azure-api.net/todo' +var apimServiceId = useAPIM ? apim.outputs.resourceId : '' // Organize resources in a resource group resource rg 'Microsoft.Resources/resourceGroups@2021-04-01' = { @@ -101,7 +102,7 @@ module web 'br/public:avm/res/web/static-site:0.3.0' = { } // The application backend -module api 'br/public:avm/res/web/site:0.3.5' = { +module api 'br/public:avm/res/web/site:0.3.9' = { name: 'api' scope: rg params: { @@ -133,6 +134,12 @@ module api 'br/public:avm/res/web/site:0.3.5' = { SCM_DO_BUILD_DURING_DEPLOYMENT: 'True' ENABLE_ORYX_BUILD: 'True' } + logsConfiguration: { + applicationLogs: { fileSystem: { level: 'Verbose' } } + detailedErrorMessages: { enabled: true } + failedRequestsTracing: { enabled: true } + httpLogs: { fileSystem: { enabled: true, retentionInDays: 1, retentionInMb: 35 } } + } storageAccountResourceId: storage.outputs.resourceId } } @@ -354,12 +361,19 @@ module apim 'br/public:avm/res/api-management/service:0.2.0' = if (useAPIM) { } //Configures the API settings for an api app within the Azure API Management (APIM) service. -module apiConfig '../../../../../common/infra/bicep/app/website-config.bicep' = if (useAPIM) { +module apiConfig 'br/public:avm/res/web/site:0.3.9' = if (useAPIM) { name: 'apiconfig' scope: rg params: { - apimServiceId: useAPIM ? apim.outputs.resourceId : '' - apiName: apimApiName + kind: 'app' + name: api.outputs.name + serverFarmResourceId: appServicePlan.outputs.resourceId + location: location + apiManagementConfiguration: { + apiManagementConfig: { + id: '${apimServiceId}/apis/${apimApiName}' + } + } } } diff --git a/templates/todo/projects/nodejs-mongo-swa-func/.repo/bicep/repo.yaml b/templates/todo/projects/nodejs-mongo-swa-func/.repo/bicep/repo.yaml index 1e4a47a439f..3140b4ef005 100644 --- a/templates/todo/projects/nodejs-mongo-swa-func/.repo/bicep/repo.yaml +++ b/templates/todo/projects/nodejs-mongo-swa-func/.repo/bicep/repo.yaml @@ -118,9 +118,6 @@ repo: - from: ../../../../common/infra/bicep/app/applicationinsights-dashboard.bicep to: ./infra/app/applicationinsights-dashboard.bicep - - from: ../../../../common/infra/bicep/app/website-config.bicep - to: ./infra/app/website-config.bicep - - from: ./../../ to: ./ ignore: diff --git a/templates/todo/projects/nodejs-mongo/.repo/bicep/infra/main.bicep b/templates/todo/projects/nodejs-mongo/.repo/bicep/infra/main.bicep index 7d84e6cdaaf..a6435acdad0 100644 --- a/templates/todo/projects/nodejs-mongo/.repo/bicep/infra/main.bicep +++ b/templates/todo/projects/nodejs-mongo/.repo/bicep/infra/main.bicep @@ -79,6 +79,7 @@ var actualDatabaseName = !empty(cosmosDatabaseName) ? cosmosDatabaseName : defau var apiUri = 'https://${api.outputs.defaultHostname}' var webUri = 'https://${web.outputs.defaultHostname}' var apimApiUri = 'https://${apim.outputs.name}.azure-api.net/todo' +var apimServiceId = useAPIM ? apim.outputs.resourceId : '' // Organize resources in a resource group resource rg 'Microsoft.Resources/resourceGroups@2021-04-01' = { @@ -88,7 +89,7 @@ resource rg 'Microsoft.Resources/resourceGroups@2021-04-01' = { } // The application frontend -module web 'br/public:avm/res/web/site:0.2.0' = { +module web 'br/public:avm/res/web/site:0.3.9' = { name: 'web' scope: rg params: { @@ -103,11 +104,17 @@ module web 'br/public:avm/res/web/site:0.2.0' = { appCommandLine: 'pm2 serve /home/site/wwwroot --no-daemon --spa' alwaysOn: true } + logsConfiguration: { + applicationLogs: { fileSystem: { level: 'Verbose' } } + detailedErrorMessages: { enabled: true } + failedRequestsTracing: { enabled: true } + httpLogs: { fileSystem: { enabled: true, retentionInDays: 1, retentionInMb: 35 } } + } } } // The application backend -module api 'br/public:avm/res/web/site:0.2.0' = { +module api 'br/public:avm/res/web/site:0.3.9' = { name: 'api' scope: rg params: { @@ -137,6 +144,12 @@ module api 'br/public:avm/res/web/site:0.2.0' = { SCM_DO_BUILD_DURING_DEPLOYMENT: 'True' ENABLE_ORYX_BUILD: 'True' } + logsConfiguration: { + applicationLogs: { fileSystem: { level: 'Verbose' } } + detailedErrorMessages: { enabled: true } + failedRequestsTracing: { enabled: true } + httpLogs: { fileSystem: { enabled: true, retentionInDays: 1, retentionInMb: 35 } } + } } } @@ -339,13 +352,19 @@ module apim 'br/public:avm/res/api-management/service:0.2.0' = if (useAPIM) { } //Configures the API settings for an api app within the Azure API Management (APIM) service. -module apiConfig '../../../../../common/infra/bicep/app/website-config.bicep' = if (useAPIM) { +module apiConfig 'br/public:avm/res/web/site:0.3.9' = if (useAPIM) { name: 'apiconfig' scope: rg params: { - apimServiceId: useAPIM ? apim.outputs.resourceId : '' - apiName: apimApiName - apiAppName: api.outputs.name + kind: 'app' + name: api.outputs.name + serverFarmResourceId: appServicePlan.outputs.resourceId + location: location + apiManagementConfiguration: { + apiManagementConfig: { + id: '${apimServiceId}/apis/${apimApiName}' + } + } } } diff --git a/templates/todo/projects/nodejs-mongo/.repo/bicep/repo.yaml b/templates/todo/projects/nodejs-mongo/.repo/bicep/repo.yaml index e21870b2c10..474664a4d17 100644 --- a/templates/todo/projects/nodejs-mongo/.repo/bicep/repo.yaml +++ b/templates/todo/projects/nodejs-mongo/.repo/bicep/repo.yaml @@ -115,9 +115,6 @@ repo: - from: ../../../../common/infra/bicep/app/applicationinsights-dashboard.bicep to: ./infra/app/applicationinsights-dashboard.bicep - - from: ../../../../common/infra/bicep/app/website-config.bicep - to: ./infra/app/website-config.bicep - - from: ./../../ to: ./ ignore: diff --git a/templates/todo/projects/python-mongo-aca/.repo/bicep/infra/main.bicep b/templates/todo/projects/python-mongo-aca/.repo/bicep/infra/main.bicep index 5edd6a772b9..b08bd293495 100644 --- a/templates/todo/projects/python-mongo-aca/.repo/bicep/infra/main.bicep +++ b/templates/todo/projects/python-mongo-aca/.repo/bicep/infra/main.bicep @@ -418,16 +418,6 @@ module apim 'br/public:avm/res/api-management/service:0.2.0' = if (useAPIM) { } } -//Configures the API settings for an api app within the Azure API Management (APIM) service. -module apiConfig '../../../../../common/infra/bicep/app/website-config.bicep' = if (useAPIM) { - name: 'apiconfig' - scope: rg - params: { - apimServiceId: useAPIM ? apim.outputs.resourceId : '' - apiName: apimApiName - } -} - // Data outputs output AZURE_COSMOS_CONNECTION_STRING_KEY string = connectionStringKey output AZURE_COSMOS_DATABASE_NAME string = actualDatabaseName diff --git a/templates/todo/projects/python-mongo-aca/.repo/bicep/repo.yaml b/templates/todo/projects/python-mongo-aca/.repo/bicep/repo.yaml index 03167008602..cec9c282666 100644 --- a/templates/todo/projects/python-mongo-aca/.repo/bicep/repo.yaml +++ b/templates/todo/projects/python-mongo-aca/.repo/bicep/repo.yaml @@ -125,9 +125,6 @@ repo: - from: ../../../../common/infra/bicep/app/applicationinsights-dashboard.bicep to: ./infra/app/applicationinsights-dashboard.bicep - - from: ../../../../common/infra/bicep/app/website-config.bicep - to: ./infra/app/website-config.bicep - - from: ./../../ to: ./ ignore: diff --git a/templates/todo/projects/python-mongo-swa-func/.repo/bicep/infra/main.bicep b/templates/todo/projects/python-mongo-swa-func/.repo/bicep/infra/main.bicep index bd1261af453..7b8a031eccd 100644 --- a/templates/todo/projects/python-mongo-swa-func/.repo/bicep/infra/main.bicep +++ b/templates/todo/projects/python-mongo-swa-func/.repo/bicep/infra/main.bicep @@ -83,6 +83,7 @@ var actualDatabaseName = !empty(cosmosDatabaseName) ? cosmosDatabaseName : defau var webUri = 'https://${web.outputs.defaultHostname}' var apiUri = 'https://${api.outputs.defaultHostname}' var apimApiUri = 'https://${apim.outputs.name}.azure-api.net/todo' +var apimServiceId = useAPIM ? apim.outputs.resourceId : '' // Organize resources in a resource group resource rg 'Microsoft.Resources/resourceGroups@2021-04-01' = { @@ -104,7 +105,7 @@ module web 'br/public:avm/res/web/static-site:0.3.0' = { } // The application backend -module api 'br/public:avm/res/web/site:0.3.5' = { +module api 'br/public:avm/res/web/site:0.3.9' = { name: 'api' scope: rg params: { @@ -136,6 +137,12 @@ module api 'br/public:avm/res/web/site:0.3.5' = { SCM_DO_BUILD_DURING_DEPLOYMENT: 'True' ENABLE_ORYX_BUILD: 'True' } + logsConfiguration: { + applicationLogs: { fileSystem: { level: 'Verbose' } } + detailedErrorMessages: { enabled: true } + failedRequestsTracing: { enabled: true } + httpLogs: { fileSystem: { enabled: true, retentionInDays: 1, retentionInMb: 35 } } + } storageAccountResourceId: storage.outputs.resourceId } } @@ -360,12 +367,19 @@ module apim 'br/public:avm/res/api-management/service:0.2.0' = if (useAPIM) { } //Configures the API settings for an api app within the Azure API Management (APIM) service. -module apiConfig '../../../../../common/infra/bicep/app/website-config.bicep' = if (useAPIM) { +module apiConfig 'br/public:avm/res/web/site:0.3.9' = if (useAPIM) { name: 'apiconfig' scope: rg params: { - apimServiceId: useAPIM ? apim.outputs.resourceId : '' - apiName: apimApiName + kind: 'app' + name: api.outputs.name + serverFarmResourceId: appServicePlan.outputs.resourceId + location: location + apiManagementConfiguration: { + apiManagementConfig: { + id: '${apimServiceId}/apis/${apimApiName}' + } + } } } diff --git a/templates/todo/projects/python-mongo-swa-func/.repo/bicep/repo.yaml b/templates/todo/projects/python-mongo-swa-func/.repo/bicep/repo.yaml index d04e08f9df2..15236ca7628 100644 --- a/templates/todo/projects/python-mongo-swa-func/.repo/bicep/repo.yaml +++ b/templates/todo/projects/python-mongo-swa-func/.repo/bicep/repo.yaml @@ -118,9 +118,6 @@ repo: - from: ../../../../common/infra/bicep/app/applicationinsights-dashboard.bicep to: ./infra/app/applicationinsights-dashboard.bicep - - from: ../../../../common/infra/bicep/app/website-config.bicep - to: ./infra/app/website-config.bicep - - from: ./../../ to: ./ ignore: diff --git a/templates/todo/projects/python-mongo/.repo/bicep/infra/main.bicep b/templates/todo/projects/python-mongo/.repo/bicep/infra/main.bicep index 0f2327f32aa..b2291c94754 100644 --- a/templates/todo/projects/python-mongo/.repo/bicep/infra/main.bicep +++ b/templates/todo/projects/python-mongo/.repo/bicep/infra/main.bicep @@ -82,6 +82,7 @@ var actualDatabaseName = !empty(cosmosDatabaseName) ? cosmosDatabaseName : defau var webUri = 'https://${web.outputs.defaultHostname}' var apiUri = 'https://${api.outputs.defaultHostname}' var apimApiUri = 'https://${apim.outputs.name}.azure-api.net/todo' +var apimServiceId = useAPIM ? apim.outputs.resourceId : '' // Organize resources in a resource group resource rg 'Microsoft.Resources/resourceGroups@2021-04-01' = { @@ -91,7 +92,7 @@ resource rg 'Microsoft.Resources/resourceGroups@2021-04-01' = { } // The application frontend -module web 'br/public:avm/res/web/site:0.2.0' = { +module web 'br/public:avm/res/web/site:0.3.9' = { name: 'web' scope: rg params: { @@ -106,11 +107,17 @@ module web 'br/public:avm/res/web/site:0.2.0' = { appCommandLine: 'pm2 serve /home/site/wwwroot --no-daemon --spa' alwaysOn: true } + logsConfiguration: { + applicationLogs: { fileSystem: { level: 'Verbose' } } + detailedErrorMessages: { enabled: true } + failedRequestsTracing: { enabled: true } + httpLogs: { fileSystem: { enabled: true, retentionInDays: 1, retentionInMb: 35 } } + } } } // The application backend -module api 'br/public:avm/res/web/site:0.2.0' = { +module api 'br/public:avm/res/web/site:0.3.9' = { name: 'api' scope: rg params: { @@ -140,6 +147,12 @@ module api 'br/public:avm/res/web/site:0.2.0' = { SCM_DO_BUILD_DURING_DEPLOYMENT: 'True' ENABLE_ORYX_BUILD: 'True' } + logsConfiguration: { + applicationLogs: { fileSystem: { level: 'Verbose' } } + detailedErrorMessages: { enabled: true } + failedRequestsTracing: { enabled: true } + httpLogs: { fileSystem: { enabled: true, retentionInDays: 1, retentionInMb: 35 } } + } } } @@ -345,13 +358,19 @@ module apim 'br/public:avm/res/api-management/service:0.2.0' = if (useAPIM) { } //Configures the API settings for an api app within the Azure API Management (APIM) service. -module apiConfig '../../../../../common/infra/bicep/app/website-config.bicep' = if (useAPIM) { +module apiConfig 'br/public:avm/res/web/site:0.3.9' = if (useAPIM) { name: 'apiconfig' scope: rg params: { - apimServiceId: useAPIM ? apim.outputs.resourceId : '' - apiName: apimApiName - apiAppName: api.outputs.name + kind: 'app' + name: api.outputs.name + serverFarmResourceId: appServicePlan.outputs.resourceId + location: location + apiManagementConfiguration: { + apiManagementConfig: { + id: '${apimServiceId}/apis/${apimApiName}' + } + } } } diff --git a/templates/todo/projects/python-mongo/.repo/bicep/repo.yaml b/templates/todo/projects/python-mongo/.repo/bicep/repo.yaml index 76ef91da08b..9eaa7010712 100644 --- a/templates/todo/projects/python-mongo/.repo/bicep/repo.yaml +++ b/templates/todo/projects/python-mongo/.repo/bicep/repo.yaml @@ -128,9 +128,6 @@ repo: - from: ../../../../common/infra/bicep/app/applicationinsights-dashboard.bicep to: ./infra/app/applicationinsights-dashboard.bicep - - from: ../../../../common/infra/bicep/app/website-config.bicep - to: ./infra/app/website-config.bicep - - from: ./../../ to: ./ ignore: