Select an IIS Website "Identity" conditionally depending on Deployment Target


Is it possible to conditionally switch between the type of “Identity” for the “Deploy to IIS” process depending on the Deployment Target?

For context when we’re deploying our IIS website to our QA environment hosted in our local network we would prefer to use the “Application Pool Identity”, whereas in our other environments we have a custom application pool user that we use.

We could just use the “Custom user (you specify the username/password)” and feed in the credentials from variables, but that would mean that we would need to setup an additional user based on the “Application Pool Identity” to use for QA websites.

Is it possible to avoid this and conditionally just use the built-in user just for one environment?

This is in reference to this article:

Hey @p.j.riding.91 , thanks for reaching out and welcome to the community!

It looks like you can accomplish this pretty easily -

You’ll effectively need three variables:

  • Project.AppPool.AuthenticationType (Scoped values of SpecificUser and ApplicationPoolIdentity based on your desired environment setup)
  • Project.AppPool.User
  • Project.AppPool.Password

You can then structure your IIS step parameters with bound variables like so:

This will allow you to have specific user application pool identities in Production, but get the ease of standard pool identities in QA.

Give that a try, and let me know if you run into any issues or have any questions, we’re happy to help!

1 Like

I didn’t spot that you could also bind the authentication type. That’s perfect - thanks!

1 Like

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