How to setup an Web API in IIS that should run on specific windows account

Vijay Chidrambram 20 Reputation points
2023-08-22T04:21:23.5333333+00:00

Hi, I want to host an Web API developed in .NET Core in IIS 10 (Microsoft Hyper-V Server) and want to know how to setup the Web API that should run on a specific windows account.

Please assist me on setting up the wep api run on a specific windows identity. Thanks!

Internet Information Services
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,553 questions
ASP.NET API
ASP.NET API
ASP.NET: A set of technologies in the .NET Framework for building web applications and XML web services.API: A software intermediary that allows two applications to interact with each other.
335 questions
0 comments No comments
{count} votes

Accepted answer
  1. Yurong Dai-MSFT 2,816 Reputation points Microsoft Vendor
    2023-08-22T07:01:02.1233333+00:00

    Hi @Vijay Chidrambram,

    Configure the website:

    Open Internet Information Services (IIS) Manager on the server.

    In the Connections pane, right-click the Sites node and select Add Site.

    Configure website settings such as site name, physical path (pointing it to the publish directory), hostname, and port.

    Under the "Connect as…" section, click "Specific user" and provide the credentials of the Windows account you want to use to run the application.

    Configure the application pool:

    In IIS Manager, navigate to Application Pools.

    Find the application pool corresponding to the website you just created, right-click and select "Advanced Settings".

    Under the "Process Model" section, set "Identity" to "Custom Account" and provide the credentials of the Windows account to use.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the email notification for this thread.

    Best regards,

    Yurong Dai

    1 person found this answer helpful.

2 additional answers

Sort by: Most helpful
  1. Vahid Ghafarpour 21,240 Reputation points
    2023-08-22T05:12:16.9333333+00:00
    • Open "Internet Information Services (IIS) Manager".
    • Under the server node, go to "Application Pools".
    • Right-click and choose "Add Application Pool".
    • Give the pool a name, select the .NET CLR version and pipeline mode according to your application's requirements.
    • Under "Process Model", set the "Identity" to the desired Windows account. You can set it to a built-in account or a custom user account.
    0 comments No comments

  2. Vijay Chidrambram 20 Reputation points
    2023-08-22T06:12:14.23+00:00

    Yes, I created the application pool and set it to my desired windows identity.

    Also assigned the application pool to the Web API under Default web site. However, it still does not work for the identity. Did I miss any step here?

    Please clarify.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.