Home > Software engineering >  Azure App Service Bicep template with deployment slot
Azure App Service Bicep template with deployment slot

Time:10-25

Here is my bicep template to deploy App service. Need help to add a slot with name: 'staging' (settings to be cloned from parent)

resource appServicePlan 'Microsoft.Web/serverfarms@2020-06-01' = {
  name: appServicePlanName
  location: location
  properties: {
    reserved: true
  }
  sku: {
    name: sku
  }
  kind: 'linux'
}
resource appService 'Microsoft.Web/sites@2020-06-01' = {
  name: webAppName
  location: location
  properties: {
    serverFarmId: appServicePlan.id
    siteConfig: {
      linuxFxVersion: linuxFxVersion
    }
  }
}

CodePudding user response:

You are looking for the Microsoft.Web sites/slots resource. Here a minimal example:

resource stagingSlot 'Microsoft.Web/sites/slots@2021-02-01' = {
  name: 'staging'
  parent: yourparent
  location: location
  kind: 'app'
  properties: {
    serverFarmId: appService.id
  }
}
  • Related