I am getting the following error while asp.net app trying to connect database. Login failed for user 'IIS APPPOOL\myAppPoolName'.
I use ms SqlServer 2008 r2, windows server 2008 r2.
This happened when I've just moved the application and database from one server to another.
I thought adding a new user to database named 'IIS APPPOOL\myAppPoolName' but when i try it, I'm getting following error on adding new db user wizard:
'IIS APPPOOL\myAppPoolName' is not a valid name because it contains invalid characters. (Microsoft SQL Server, Error: 15006)
How can I fix this?
Thanks in advance.
Erdem.
By default, custom application pools receive the 'Network Service' user credentials. Simply try adding a new login for your mssql server (and database, of course) for the 'Network Service' account. Read more here
Thanks @Nissim
In Sql > Security > Logins > Right-click > new login > Login name "NT AUTHORITY\NETWORK SERVICE"
In Same New login window On left side > User Mapping > Check the database you want > Select each database and in Database roles (second box below) > db_owner
Click Ok
In IIS > Application Pools > Your app pool > advance settings > Identity (change to "NetworkService")
Click Ok
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With