【发布时间】:2021-01-07 07:39:34
【问题描述】:
我想在两个不同的环境中创建相同的命名槽。不同之处在于Integration 我想启用自动交换。我尝试使用condition 执行此操作,如下所示,但这没有通过验证,因为我有两个同名的资源。
"resources": [
{
"condition": "[equals(parameters('env'), 'Integration')]",
"apiVersion": "2018-11-01",
"name": "staging", <----------------- HERE
"type": "slots",
"location": "[resourceGroup().location]",
"identity": {
"type": "SystemAssigned"
},
"dependsOn": [
"[variables('webApiWebSiteName')]"
],
"properties": {
"siteConfig": {
"autoSwapSlotName": "production" <----------------- only difference
}
}
},
{
"condition": "[equals(parameters('env'), 'Production')]",
"apiVersion": "2018-11-01",
"name": "staging", <----------------- HERE
"type": "slots",
"location": "[resourceGroup().location]",
"identity": {
"type": "SystemAssigned"
},
"dependsOn": [
"[variables('webApiWebSiteName')]"
],
"properties": {
}
}
]
【问题讨论】:
标签: azure-web-app-service azure-resource-manager arm-template azure-deployment-slots