下面是一个经过全面测试的工作 ARM 模板,它在部署成功后部署了一个“ ARR Affinity ”设置为OFF的 Azure Web 应用程序。
有用的参考:禁用 Azure Web 应用的会话关联 cookie (ARR cookie)
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"location": {
"type": "string",
"defaultValue": "[resourceGroup().location]"
},
"hostingplan.name": {
"type": "string",
"defaultValue": "[concat(resourceGroup().name, '-hp')]"
},
"webapp.name": {
"type": "string",
"defaultValue": "[resourceGroup().name]"
}
},
"resources": [
{
"type": "Microsoft.Web/serverfarms",
"name": "[parameters('hostingplan.name')]",
"apiVersion": "2016-09-01",
"sku": {
"name": "S1",
"capacity": 1
},
"properties": {
"name": "[parameters('hostingplan.name')]"
},
"location": "[parameters('location')]"
},
{
"type": "Microsoft.Web/sites",
"name": "[parameters('webapp.name')]",
"apiVersion": "2016-08-01",
"properties": {
"clientAffinityEnabled": false,
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', parameters('hostingplan.name'))]"
},
"location": "[parameters('location')]",
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', parameters('hostingplan.name'))]"
]
}
]
}