【发布时间】:2023-04-10 06:54:02
【问题描述】:
我在 Azure 上为我们的暂存和生产环境提供了完整的 ARM 模板。它通过 Azure DevOps 发布。
但是,我注意到我在我的 ARM 中为 Web 应用应用的 Web 应用设置,它也会复制到 Web 应用插槽。我知道这可以在 Azure 上手动勾选,但是有没有办法在 ARM 模板上做到这一点?我查看了 Microsoft 网站,但没有看到任何帮助,并且想知道这是否是手动任务?
{
"type": "Microsoft.Web/sites/config",
"apiVersion": "2019-08-01",
"location": "[resourceGroup().location]",
"name": "[concat(parameters('webAppName'), '/appsettings')]",
"dependsOn": [
"[parameters('webAppName')]",
"[concat(parameters('sqlDatabase'), 'constr')]"
],
"properties": {
"APPINSIGHTS_INSTRUMENTATIONKEY": "[reference(resourceId('Microsoft.Insights/components', parameters('appInsights')), '2014-04-01').InstrumentationKey]",
"ApplicationInsightsAgent_EXTENSION_VERSION": "~2",
"DiagnosticServices_EXTENSION_VERSION": "~3",
}
这就是我的应用程序设置代码的样子(还有更多应用程序设置,我不必全部复制)
下面是我的 Web App Slots ARM 代码
{
"apiVersion": "2019-08-01",
"type": "Microsoft.Web/sites/slots",
"name": "[concat(parameters('webAppName'), '/', parameters('slots')[copyIndex()])]",
"kind": "app",
"location": "[resourceGroup().location]",
"copy": {
"name": "WebAppSlots",
"count": "[length(parameters('slots'))]"
},
"properties": {
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', parameters('planName'))]"
},
"dependsOn": [
"[parameters('webAppName')]",
"[concat(parameters('sqlDatabase'), 'constr')]"
]
},
我非常感谢您对此事的任何见解。
谢谢你:)
【问题讨论】:
标签: json azure web-applications azure-devops azure-resource-manager