From 57830d797ad1425c0c254cbd24383edc19566f92 Mon Sep 17 00:00:00 2001 From: Wei Lim Date: Mon, 18 Dec 2023 12:24:57 -0800 Subject: [PATCH] bicep core: Serialize updates for config-appsettings and config-logs(#3125) Reintroduce a `dependsOn` ordering that is required to avoid race conditions with updating `Microsoft.Web/sites/config` within the same deployment. --- .../infra/bicep/core/host/appservice.bicep | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/templates/common/infra/bicep/core/host/appservice.bicep b/templates/common/infra/bicep/core/host/appservice.bicep index 25e4caca2cf..bef4d2ba432 100644 --- a/templates/common/infra/bicep/core/host/appservice.bicep +++ b/templates/common/infra/bicep/core/host/appservice.bicep @@ -65,16 +65,6 @@ resource appService 'Microsoft.Web/sites@2022-03-01' = { identity: { type: managedIdentity ? 'SystemAssigned' : 'None' } - resource configLogs 'config' = { - name: 'logs' - properties: { - applicationLogs: { fileSystem: { level: 'Verbose' } } - detailedErrorMessages: { enabled: true } - failedRequestsTracing: { enabled: true } - httpLogs: { fileSystem: { enabled: true, retentionInDays: 1, retentionInMb: 35 } } - } - } - resource basicPublishingCredentialsPoliciesFtp 'basicPublishingCredentialsPolicies' = { name: 'ftp' properties: { @@ -90,7 +80,9 @@ resource appService 'Microsoft.Web/sites@2022-03-01' = { } } -module config 'appservice-appsettings.bicep' = { +// Updates to the single Microsoft.sites/web/config resources that need to be performed sequentially +// sites/web/config 'appsettings' +module configAppSettings 'appservice-appsettings.bicep' = { name: '${name}-appSettings' params: { name: appService.name @@ -105,6 +97,19 @@ module config 'appservice-appsettings.bicep' = { } } +// sites/web/config 'logs' +resource configLogs 'Microsoft.Web/sites/config@2022-03-01' = { + name: 'logs' + parent: appService + properties: { + applicationLogs: { fileSystem: { level: 'Verbose' } } + detailedErrorMessages: { enabled: true } + failedRequestsTracing: { enabled: true } + httpLogs: { fileSystem: { enabled: true, retentionInDays: 1, retentionInMb: 35 } } + } + dependsOn: [configAppSettings] +} + resource keyVault 'Microsoft.KeyVault/vaults@2022-07-01' existing = if (!(empty(keyVaultName))) { name: keyVaultName }