user2182397
user2182397

Reputation:

Change IIS user credentials for ASP.NET app and SQL database

IIS 7.5, ASP.NET application + MS SQL database

A website is in C:\inetpub\wwwroot\AppFolder

Windows authentication is allowed

SQL connection string contains user name and password

Trying to open a website

Cannot open database requested by the login. The login failed. Login failed for user 'IIS APPPOOL\DefaultAppPool'

Looks like wrong user credentials. My web application is set to use specific user name and password to access the database (web.config).

The problem is that I don't have IIS Manager Users feature. I have installed IIS completely, all services and checkboxes enabled, but still no such feature.

Configure this IIS user account to successfully access the web app

Upvotes: 0

Views: 2578

Answers (1)

Andrei Dragotoniu
Andrei Dragotoniu

Reputation: 6335

Create a sql user and configure it to access that one database. Give it enough rights to be able to do what it needs to do.

Change your connection string so it contains those credentials. That's all you need.

At the moment it tries the user setup under your app pool and that clearly is not going to work. So, if you want to change the app user look at the advanced settings of your App Pool.

-edited-

the user the app is running under ( windows account ) and the user who accesses the database are not the same thing. Keep them separate. One for db, one for app pool.

Upvotes: 0

Related Questions