问题描述
我正在尝试通过ARM模板创建Web应用程序插槽.
I am trying to create web app slots through ARM template.
我能够创建它们,但是看起来默认行为是将它们创建为当前Web应用程序状态的副本.这导致我的广告位继承了应用设置,连接字符串,虚拟目录等.
I was able to create those but it looks like the default behavior is to create the them as a copy of the current web app state. This result in my slot inheriting app settings, connection strings, virtual directories, ....
这里有一个复制示例,演示了行为 https://github.com/ggirard07/ARMSlotWebConfig
Here a reproduction sample which demonstrate the behavior https://github.com/ggirard07/ARMSlotWebConfig.
我想让我的插槽干净整洁,这是azure门户的默认行为.门户网站可以通过指定创建插槽时发布的"configSource": "",
值来允许用户选择行为.
I want my slot clean and fresh instead, which is the azure portal default behavior. The portal is able to allow a user to select the behavior by specifying the "configSource": "",
value it posts when creating the slot.
反正有从ARM模板内部实现相同目标的功能吗?
Is there anyway to achieve the same from inside an ARM template?
推荐答案
要防止从生产应用程序复制设置,只需在插槽properties
中添加一个空的siteConfig
对象.例如
To prevent the copying of settings from the production app, just add an empty siteConfig
object in the slot properties
. e.g.
{
"apiVersion": "2015-08-01",
"type": "slots",
"name": "maintenance",
"location": "[resourceGroup().location]",
"dependsOn": [
"[resourceId('Microsoft.Web/Sites/', variables('webSiteName'))]"
],
"properties": {
"siteConfig": { }
}
}
我发送了 PR 来说明您的存储库.
I sent a PR to illustrate on your repo.
这篇关于从ARM模板创建Azure Web应用程序插槽而无需复制原始Web应用程序配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!