There is no webserver without a database.
- For MSSQL disable
Auto Close. Go to Database
Properties > Options > Automatic. What happens is the db won´t go to sleep. This setting should be default for MSSQL 2017.
- IIS should be able to connect to a db. You might use
NT AUTHORITY\NETWORK SERVICEor
NT AUTHORITY\SYSTEMbut these accounts are too powerful and you shouldn´t use them. Instead use
IIS APPPoolidentity. Open
Microsoft SQL Management Studio > Object Explorer > Security > Logins. Every db has its own
Securityfolder but its missing
Loginsfolder so stay at the highest level.
New Login... from context menu. Insert login name ie
IIS APPPOOL\MyAppPoolName. Do not use Search button! It won´t work as AppPool identity is virtual. MSSQL cannot find it. Select
User Mapping and then click ok.
Where does AppPool identity comes from? When you create an IIS website it automatically creates an AppPool.