1

I want to define a separate "Application Pool" in ASP.NET Web API
for each Controller with different user to execute under

I want it for defining a separate user name for each controller that without using the Impersonation class. Each user credentials for each App Pool (w3wp.exe) for each controller

In ASP.NET classic (and in WCF), I have made it using Folder for each handler (ASMX or custom) that host and define a local web.config of its own, with the configuration in the IIS for each folder (will define as IIS Application)

One of the alternatives is to: Create several Web Applications for each controller - bad design That's the option I prefer to avoid ...

My scenario is: I have to run and execute 3 services under 3 difference application user accounts, I know the option and the alternative of using Impersonation Class and provide a username and password within the code itself, that option is bad because, I have to save and manage the username and pw in config file ... I want the username and pw will be at the service level configure by IT team as part of the App Pool IIS config

Can i get this action and capabilities using Web API for each conroller?

Thanks Itzik BS

1 Answer 1

1

As far as I can say, this is not possible as the Application Pool is set per Web Application.

You could create several Web Applications each hosting one controller but that does not sound like a good solution.

Maybe it would help if you give more details as what problem you are trying to solve with this solution.

Sign up to request clarification or add additional context in comments.

3 Comments

Hi Julien Create several Web Applications - That's the option I prefer to avoid ...
Hi Julien, Create several Web Applications - That's the option I prefer to avoid ... The scenario is: I have to run and execute 3 services under 3 difference application user accounts, I know the option and the alternative of using Impersonation Class and provide a username and password within the code itself, that option is bad because I have to save and manage the username and pw in config file ... i want the username and pw will be at the service level configure by IT as part of the App Pool IIS config
Unfortunately you don't really have other options. AppPools are per application in IIS. If you don't want to end up managing more than one application, you will have to manage it yourself in code and storing identities for impersonation purposes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.