Tenant Specific Variable values Per Environment/Deployment Target

I am trying to get my head around how best to define variables for Tenants, specifically trying to deploy IIS Application where I need to provide an ApplicationPool Name, Custom User Account and Password.

Each Tenant will have an ApplicationPool of their own, and this will run as a Custom User, again a User per Tenant, but also a different User per ‘tier’.

If in UAT Environment my WebServer wants to use

  • an application pool called web-tenent1-ap
  • as a user web-tentant1-u
  • password web-tenant1-p

and likewise the AppServer might use

  • app-tenent1-ap
  • app-tentant1-u
  • app-tenant1-p

So I create a variable set, use Variable Templates and perhaps have the following:

  • Tenant.WebServer.ApplicationPool
  • Tenant.WebServer.UserName
  • Tenant.WebServer.UserPassword
  • Tenant.AppServer.ApplicationPool
  • Tenant.AppServer.UserName
  • Tenant.AppServer.UserPassword

Seems painful as I can’t provide Tenant level ‘Scope’ to say 'it is this for Role WebServer and this for Role AppServer - like I can scope things in a project. But even if I could use Scope - I would want it to know that I ‘must’ provide a value for each scope (like it knows I must provide a value for the variable)…so not sure how it would know that it needs a password for WebServer and AppServer.

The reason I am having this issue is mainly because the IIS Web Application Step Template will not let me just say “use an application pool called this” - it want to create it…and to create it I needs to know stuff I’d rather not know.

Additionally - the problem seems bigger if the value differ by Environment - in a Project I can Scope a variable by Environment, but once Tenants are involves I can’t do that. I would need to have a Variable per Environment if I wanted to provide the value on a Tenant specific basis.

Replying to my own post (bad form?)…

I was trying to use Variable Sets when really I should have used Project Templates as Project Templates automatically offer me (in the Tenant view) a ‘pot’ for each Variable / Environment combination.

Given I may have several projects deploying the same or similar Packages what would have been really useful would be the ability to define a re-usable Project Template…a Project Template Template?! or perhaps when I import a VariableSet I can choose whether to import it as a Common Variable Set or a Project Variable Set…because Common Variable Sets do not offer me the xEnvironment combination for Tenant values.

Hi Stuart,

Thanks for getting in touch! I’m terribly sorry about the delay in getting back to you. I’ve had a discussion with my team, and they’ve come up with a workaround to approach this (though it’s slightly hacky).

They’ve defined environment specific common variable templates (i.e. Dev.ApplicationPool and UAT.ApplicationPool so that they could define the shared values once on the tenant. Then in the variable set they have a variable that scopes to the environments. So a variable named ApplicationPool scoped to Dev evaluates to #{Dev.ApplicationPool} and the same variable name scoped to UAT evaluates to #{UAT.ApplicationPool}.

I’m hoping this helps in your scenario! Let me know what you think or if you have any further questions moving forward. :slight_smile:

Best regards,


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.