0

我在 Azure 资源模板中有几个插槽,我试图弄清楚如何从参数 ( slot_for_deploy) 中指定部署插槽,但我还没有找到解决方案。

当前模板:

{
      "parameters": {
          "slots_dev_name": {
              "defaultValue": "dev",
          },
        "slot_for_deploy": {
          "defaultValue": "dev",
        },
      },
    "resources": [
      {
        "type": "Microsoft.Web/serverfarms",
        "kind": "app",
        "name": "[parameters('serverfarms_azm_name')]",
        "apiVersion": "2016-09-01",
      },
      {
        "type": "Microsoft.Web/sites",
        "kind": "app",
        "name": "[parameters('sites_azm_name')]",
        "resources": [              
          {
            "type": "Microsoft.Web/sites/slots",
            "kind": "app",
            "name": "[concat(parameters('sites_azm_name'), '/', parameters('slots_dev_name'))]",
          },
          {
            "name": "MSDeploy",
            "type": "extensions",
            "properties": {
              "packageUri": "...",
              "setParameters": {
                "IIS Web Application Name": "[parameters('sites_azm_name')]"
               }
            }
          }
        ]
      }
    ]
  }
4

1 回答 1

0

查看这篇博文,作者在其中解释了部署槽和 ARM 模板。https://msftplayground.com/2016/12/azure-resource-templates-deployment-slots/

于 2018-09-03T10:23:50.663 回答