Application Pool Identity
Every worker process runs as a Windows account. That identity decides which files, folders and databases your app can reach.
On this page · 5 min · Beginner
On this page
- In simple words
- Learning objectives
- Explanation
- Code example
- Step by step
- Real-world use
- Common mistakes
- Best practices
- Remember this
- Practice exercise
- Mini quiz
- Related topics
- My notes
- Reading time
- 5 min
- Difficulty
- Beginner
- Updated
- Oct 30, 2026
Related tutorials
Interview questions
In simple words#
The app pool identity is the ID badge the kitchen team wears. The badge decides which store rooms (folders) and lockers (databases) they can open. ApplicationPoolIdentity gives each team its own minimal badge.
- ApplicationPoolIdentity
- Default virtual account: IIS AppPool\PoolName.
- LocalSystem
- All-powerful account — avoid.
- Custom account
- A domain/service account, e.g. for network shares.
Learning objectives#
- Explain the identity options
- Grant folder permissions to a pool identity
- Grant SQL Server access to a pool
- Choose identities safely
Explanation#
ApplicationPoolIdentity (default) creates a virtual account per pool named IIS AppPool\PoolName. It has few rights — that is good.
NetworkService and LocalService are shared built-in accounts; LocalSystem has full control of the machine and should not run web apps.
Grant only what the app needs: read on the site folder, modify on folders it writes to (uploads, logs).
For SQL Server on the same machine, create a login for IIS AppPool\PoolName. For other machines, use a domain account (or gMSA) or SQL authentication from a vault.
Code example: Permissions for the ShopPool identity#
# Read & execute on the site, modify on the uploads folder
icacls "C:\inetpub\shop" /grant "IIS AppPool\ShopPool:(OI)(CI)RX"
icacls "C:\inetpub\shop\uploads" /grant "IIS AppPool\ShopPool:(OI)(CI)M"
# SQL Server on the same machine (run in SSMS):
# CREATE LOGIN [IIS AppPool\ShopPool] FROM WINDOWS;
# USE ShopDB; CREATE USER [IIS AppPool\ShopPool] FOR LOGIN [IIS AppPool\ShopPool];
# ALTER ROLE db_datareader ADD MEMBER [IIS AppPool\ShopPool];
# ALTER ROLE db_datawriter ADD MEMBER [IIS AppPool\ShopPool];
# Connection string then uses Windows auth:
# Server=localhost;Database=ShopDB;Integrated Security=True;TrustServerCertificate=True
processed file: C:\inetpub\shop — the app can read its files, write uploads, and query ShopDB without any password in configuration.
This example is illustrative. Copy or download it and run it in your own environment; the expected output is shown above.
Step-by-step explanation#
- (OI)(CI) applies the permission to files and subfolders.
- RX = read & execute; M = modify.
- The SQL login is created for the pool’s virtual account.
- The connection string uses Integrated Security — no password.
Real-world use case#
A security audit passes because every app runs as its own pool identity with only the permissions it needs.
Common mistakes#
A compromised app would own the server. Grant the specific permission instead.
Use the pool identity and the least permission needed.
Best practices#
- Keep ApplicationPoolIdentity by default
- Grant least privilege with icacls
- Use gMSA/domain accounts for network resources
- Never use LocalSystem for web apps
Remember this#
Default identity = IIS AppPool\PoolName.
Grant RX for the site, M only where it writes.
Never LocalSystem.
Practice exercise#
Your task: Grant ShopPool read access to D:\shared\media.
Show solution
icacls "D:\shared\media" /grant "IIS AppPool\ShopPool:(OI)(CI)R"
Mini quiz#
What is the Windows account name for ApplicationPoolIdentity of a pool called ApiPool?
Want more? Practise all IIS MCQs · IIS interview questions
My notes#
Saved in this browser.