What is the max limit on nested variables

When using variable substitution, how many embedded variables deep can one go?

Hi Steve,

Thanks for getting in touch. I think the quick answer to your question is as deep as you want. I’ve built an example nested variables 5 deep:

[Var1] = '1'
[Var2] = '#{Var1}2'
[Var3] = '#{Var2}3'
[Var4] = '#{Var3}4'
[Var5] = '#{Var4}5'

This resolves during deployment to:

[Var1] = '1'
[Var2] = '12'
[Var3] = '123'
[Var4] = '1234'
[Var5] = '12345'

I find the best way to test these kinds of questions/assumptions is to construct a sample project in Octopus, and leverage the Variable Diagnostics.

Octopus uses the Octostache templating library which is open-source and you can take a look at the usage scenarios by inspecting the tests

Hope that helps!