diff --git a/azuredeploy.json b/azuredeploy.json index 49e44a4..96dc105 100644 --- a/azuredeploy.json +++ b/azuredeploy.json @@ -626,6 +626,7 @@ } }, { + "condition": "[parameters('redisDeploySwitch')]", "type": "Microsoft.Resources/deployments", "apiVersion": "2017-05-10", "name": "redisTemplate", @@ -643,7 +644,7 @@ } }, "templateLink": { - "uri": "[concat(variables('moodleCommon').baseTemplateUrl,'redis', if(parameters('redisDeploySwitch'), '', '-none'), '.json',parameters('_artifactsLocationSasToken'))]" + "uri": "[concat(variables('moodleCommon').baseTemplateUrl, 'redis.json', parameters('_artifactsLocationSasToken'))]" } } }, @@ -761,7 +762,7 @@ "value": "[reference('networkTemplate').outputs.ctlrPubIpId.value]" }, "redisKey": { - "value": "[reference('redisTemplate').outputs.redisKey.value]" + "value": "[if(parameters('redisDeploySwitch'), reference('redisTemplate').outputs.redisKey.value, 'None')]" }, "azureSearchKey": { "value": "[if(equals(parameters('searchType'), 'azure'), reference('searchTemplate').outputs.azureSearchKey.value, 'None')]" diff --git a/nested/redis-none.json b/nested/redis-none.json deleted file mode 100644 index 0167fae..0000000 --- a/nested/redis-none.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json", - "contentVersion": "1.0.0.0", - "parameters": { - "moodleCommon": { - "metadata": { - "description": "Common Moodle values" - }, - "type": "object" - }, - "subnetIdRedis": { - "metadata": { - "description": "Azure resource ID of the subnet where this Redis instance is to be deployed" - }, - "type": "string" - } - }, - "resources": [ - ], - "variables": { - "documentation1": "This sub-template is a workaround to the ARM if(,,)'s eager/call-by-value limitation that prevents us", - "documentation2": "from using the if(,,) in case redisDeploySwitch is false (the listKeys() is still evaluated because of the eager semantics).", - "documentation3": "This just returns 'None' as its only output that matches the redis.json template." - }, - "outputs": { - "redisKey": { - "value": "[if(parameters('moodleCommon').redisDeploySwitch, 'Impossible', 'None')]", - "type": "string" - } - } -}