Link to home
Create AccountLog in
Avatar of mgbm_it
mgbm_it

asked on

ASP.Net remote database impersonation

I have 2 servers (IIS and SQL Server) where I'm hosting a web application that connects to the database via a domain user
what I have done is:
- added the username to the identity at the application pool (e.g. domain\db_account)
- granted user access to database
- granted IIS server access to database (domain\servername$)
- using the following connection string:
      <add name="DBNameConnectionString" connectionString="Data Source=SQLServerName;Initial Catalog=DB_Name;Integrated Security=True" providerName="System.Data.SqlClient" />

whenever I try to start the application I get an "access denied" error with the username (domain\db_account)

I have tried to launch SQL Server management studio from IIS server via this account and connect to database ... worked perfectly !!!
when I connect the application to a local instance of SQL Server (at IIS Server Machine) it's working perfectly !!!

what am I missing ?
ASKER CERTIFIED SOLUTION
Avatar of enaliev
enaliev
Flag of Russian Federation image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of mgbm_it
mgbm_it

ASKER

@enaliev
sorry it did not work... I have applied that then performed an IIS Reset and database service restart but no luck

and other hint ?
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of mgbm_it

ASKER

close to actual solution