0

I'm using Bicep to deploy Azure resources. I faced a situation where I thought bicep is clearing default service settings.

What I do:

  1. Create a resource
  2. 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:

enter image description here

klucyszy
  • 152
  • 6
  • Does this answer your question? [Azure Bicep - What if command showing resource changes when deploying with the same template](https://stackoverflow.com/questions/73685615/azure-bicep-what-if-command-showing-resource-changes-when-deploying-with-the-s) – Thomas Sep 28 '22 at 19:16

0 Answers0