0

My goal is to deploy a packaged .zip with msDeploy and another if a condition is met. currently the template looks like this:

"resources": [
    {
      "name": "MSDeploy",
      "type": "Extensions",
      "apiVersion": "2015-02-01",
      "dependsOn": [
        "[resourceId('Microsoft.Web/Sites', variables('functionAppName'))]"
      ],
      "properties": {
        "addOnPackages": [
        {
           "packageUri": "[parameters('zipUri')]"
        },

        {
           "packageUri": "[if(parameters('boolparam'), parameters('zipUri2'), '')]"
        }
        ]
      }
    }
  ]

This works if boolparam is true, but fails if it is false. Is it possible to always deploy zipUri, and zipUri2 with condition?

4c74356b41
  • 69,186
  • 6
  • 100
  • 141
Razoll
  • 107
  • 1
  • 1
  • 7

1 Answers1

1

you can try doing this:

"variables": {
    "package1": [
        {
            "packageUri": "[parameters('zipUri')]"
        }
    ]
    "package2": [
        {
            "packageUri": "[parameters('zipUri2')]"
        }
    ]
}

and then in your msdeploy definition:

"properties": {
    "addOnPackages": "[if(parameters('boolparam'), concat(variables('package1'), variables('pakcage2')), variables('package1'))]"
4c74356b41
  • 69,186
  • 6
  • 100
  • 141