I'm using Bicep to deploy Azure resources. I faced a situation where I thought bicep is clearing default service settings.
What I do:
- Create a resource
- Do what-if after the creation of the resource
As a result of what-if bicep give me a lot of modifications that are not included in my bicep file.
Bicep script:
resource functionApp 'Microsoft.Web/sites@2022-03-01' = {
name: functionAppName
location: location
kind: kind
identity: {
type: 'SystemAssigned'
}
properties: {
enabled: true
reserved: true
serverFarmId: appServicePlanId
httpsOnly: true
siteConfig: {
numberOfWorkers: 1
linuxFxVersion: linuxFxVersion
acrUseManagedIdentityCreds: false
alwaysOn: true
http20Enabled: false
localMySqlEnabled: false
netFrameworkVersion: '4.6'
appSettings: defaultAppsettings
}
}
tags: tags
}
resource functionAppStagingSlot 'Microsoft.Web/sites/slots@2022-03-01' = {
name: '${functionAppName}/${stagingSlotName}'
location: location
kind: kind
identity: {
type: 'SystemAssigned'
}
properties: {
enabled: true
reserved: true
serverFarmId: appServicePlanId
httpsOnly: true
siteConfig: {
numberOfWorkers: 1
linuxFxVersion: linuxFxVersion
acrUseManagedIdentityCreds: false
alwaysOn: true
http20Enabled: false
localMySqlEnabled: false
netFrameworkVersion: '4.6'
appSettings: defaultAppsettings
}
}
tags: tags
}
Bicep what-if result: