Condition did in ARM templates where not that easy to implement. In the new Azure RM APIs a property condition is added. This condition makes many scenarios a lot easier to implement.
Add condition property to a resource object, the resource object will only be deployed when the condition is met. The following sample code will show this:
"resources": [ { "condition": "[equals(parameters('newOrExisting'),'new')]", "type": "Microsoft.Storage/storageAccounts", "name": "[variables('storageAccountName')]", "apiVersion": "2017-06-01", "location": "[resourceGroup().location]", "sku": { "name": "[variables('storageAccountType')]" }, "kind": "Storage", "properties": {} },
The full code sample can be found at Ryan Jones GitHub.
The equals function will return a Boolean that is used as input for the condition.
This new feature in ARM Templates will make templates more readable, faster to develop and less need to copy one version of a template to different files to implement a condition.