Variable scope and step scope

Hi, we have a site made of several .Net applications which we are deploying using Octopus Deploy. Now we have variables in library variable sets where variables have been scoped by environment and roles, however, some environments have only one server which has more than one role.

What I have noticed is that even if the steps in deployment project are scoped to one role, when the variables are evaluated and the server has more than one role, then the evaluation is non deterministic and unexpected values end up in the configuration files being introduced by the variable replacement feature.

Is this expected behavior?


Thanks for getting in touch! This is by design, what you have probably found is that in any of these combinations you could have expected different results. While I could go into details here it is probably better explained by this blog post.
This will show you the different issues around variable scoping.
Sorry that it has caused this confusion even internally sometimes we debate about what should be expected.

Sorry if this was not the news you expected.


Hi Daniel,

I kind of expected this answer and had already read that article. We are already moving in a different direction which will avoid us this limitation.

Thanks for the prompt response.