1

I have an ASP NET APP that's trying to access a sql server database, when I run it, I get an error saying

"Login Failed for user IIS APPPOOL\DefaultAppPool"

Searching the web I found that I should grant access to this user, so I executed the following script:

grant  execute on schema :: dbo to [IIS APPPOOL\DefaultAppPool]

It executed succesfully as a script for my database, but I still get the "Login Failed" error.

What's missing?

2 Answers 2

3

Check the user your DefaultAppPool is using to connect.

On your IIS manager check DefaultAppPool advanced properties and look for Identity. You need to give it a user with enough privileges, depending on what your site is going to do.

I usually create different AppPools for different sites depending on what they will do, for example, if your app will write documents to a folder on your server, the user of the AppPool will need writing access to that folder.

Also is not a good idea to use an administrator user, as it could lead to potential security breaches. However it could be a good way to check if your problem comes from there.

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

1 Comment

IN SSME I added a login for NT AUTHORITY\NETWORK SERVICE ("NT AUTHORITY\Servicio de red" in spanish), in user mappings gave it db_Owner role membership for the database. In IIS7.5, DefaultAppPool is set as ApplicationPoolIdentity (ProcessModel\Identity). Don't know what else to do... My site is a test site, I want to give it privileges for everything for starters
-1

I think I already know what it is. When I upgraded SQL Server Express, it installed a new server .\SQLEXPRESS (because I used "new sql instance"), remote connections where configured in this server and not LocalDB, my database was still in LocalDB. But now I get other error, maybe related to WCF Data Services...

Comments

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.