1
votes

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.'.

1
why you need this? this shouldnt be needed - 4c74356b41

1 Answers

0
votes

What the property dependsOn meaning is that Define the order for deploying resources in Azure Resource Manager Templates, you can get more details from this document.

It also will cause the cyclic dependence if you give the wrong orders. So you should set the dependsOn property carefully.

For the error you posted, I think you should set the value of the dependsOn property with the real resources as the document says.