Issue with variable scope specificity

I am using Octopus deploy I have a variable that needs different value in production than in our other environments. I have it role scoped for the non-prod value, and role and environment scoped for our production value. In a recent deployment to production the non-production value was used in production.

I’ve reviewed the Scope Specificity documentation ( and my configuration (role vs role and environment) seems to be non-deterministic. Is this true?

I could scope my non-prod value to include all of my non-prod environments (role and environment); however, this will be difficult to maintain with nearly 40 environments.

Would you please take a look at my scenario and let me know if the variable scoping I’m trying to use is non-deterministic?


Could you show a screenshot of your variables. Does the role need to be defined? Feel free to obscure the variable values, what I want to see is the names and the scope.

I don’t understand why you also need to scope to roles, but maybe that will show when I see how you have it all defined. In this scenario without the really big picture, just scoping one to prod and one un-scoped without also scoping roles would do it as your steps are already scoped to roles. Maybe you could explain that part to me.