Open
Description
openedon Oct 18, 2022
Bicep version
Bicep CLI version 0.11.1 (030248d)
Describe the bug
If you try to implement azure app service slot swapping via a bicep template, for example, by decompiling the example given for ARM templates https://azure.github.io/AppService/2019/10/02/Swap-slots-with-arm-templates.html then you'll get an error, saying that The expression is involved in a cycle
because the site depends on the slot but the site is the parent of the slot.
Also if you remove the dependsOn
so that the cycle error goes away, targetBuildVersion
and buildVersion
are warned as not allowed on SiteProperties
To Reproduce
param location string = resourceGroup().location
param siteName string
param buildId int
var buildVersion = '${buildId}-${deployment().name}'
resource mySite 'Microsoft.Web/sites@2018-11-01' = {
kind: 'app'
name: siteName
location: location
properties: {
targetBuildVersion: buildVersion
}
dependsOn: [
mySite_Slot
]
}
resource mySite_Slot 'Microsoft.Web/sites/slots@2018-11-01' = {
parent: mySite
kind: 'app'
name: 'PreProd'
location: location
properties: {
buildVersion: buildVersion
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment