I have a scenario, where i need to conditionally include dependsOn property on a resource in ARM template. I tried below code
"dependsOn": "[if(contains(parameters('abc'),'dependsOn'),parameters('abc').dependsOn, variables('defaultDependsOn'))]",
But the template validation errors with below message
The request content was invalid and could not be deserialized: 'Error converting value "[if(contains(parameters('abc'),'dependsOn'),parameters('abc').dependsOn, variables('defaultDependsOn'))]" to type 'System.String[]'. Path 'properties.template.resources[0].dependsOn', line 1, position 2429.'.