SQL Server 2012 - Access database with Windows authentication using IIS

 
8/29/2012
.NET, ASP.NET, IIS
1 Comments

After setting up Windows 8 and SQL Server 2012 my ASP.NET applications were not able to access my SQL databases.
Whenever I have to setup a PC in the future, I don't want to waste my time (again) to figure out how I have to configure the users correctly. Here is what I did:

My SQL Server is configured to use Windows authentication. First I changed the user(s) of my AppPools in IIS Management to 'NetworkService'.

IIS - AppPool Identity

After that I opened SQL Management Studio and added a new login by selecting 'Security' -> 'Logins' -> 'New Login...':

SQL Server - Login

Now I was able to set the owner of the database to 'NT Authority\Network Service' (in German: 'NT-AUTORITÄT\NETZWERKDIENST'). IIS was now able to access my SQL Server.

SQL Server - Owner

Feedly Feedly Tweet


Related posts


Comments


zgps

zgps

1/6/2013

You will have to go far from windows, if you don't want to waste time each time that they come up with a new business plan.