简体   繁体   English

如何在 Azure Arm 模板 (2019) 中使用粘性暂存槽

[英]How to use sticky staging slots in Azure Arm Templates (2019)

Using ARM templates I am trying to set "slotSetting: true" in my app service config - this seems to have been a options (see link below) in previous versions of the ARM template but I am not able to find how to do it with the latest version.使用 ARM 模板我试图在我的应用程序服务配置中设置“slotSetting: true” - 这似乎是以前版本的 ARM 模板中的一个选项(见下面的链接),但我无法找到如何使用最新版本。

Link to how this was solved previously: How to use sticky staging slots in Azure Arm Templates以前如何解决此问题的链接: 如何在 Azure Arm 模板中使用粘性暂存槽

I solved it by using a nested template with the older API to lock the settings but please add the correct solution if you have it!我通过使用带有旧 API 的嵌套模板锁定设置来解决它,但如果您有正确的解决方案,请添加正确的解决方案!

{
"$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
    "appServiceName": {
        "type": "string"
    },
    "appSettingsToLock": {
        "type": "array"
    },
    "conncetionStringsToLock": {
        "type": "array"
    }
},
"resources": [
    {
        "apiVersion": "2015-08-01",
        "name": "[concat(parameters('appServiceName'),'/slotconfignames')]",
        "type": "Microsoft.Web/sites/config",
        "properties": {
            "connectionStringNames": "[parameters('conncetionStringsToLock')]",
            "appSettingNames": "[parameters('appSettingsToLock')]"
        }
    }
]
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM