- BizTalk Server 2006 installed on Machine1
- SQL Server installed on Machine2
- OpWeb installed on Machine1, Using Forms authentication mode
- Both machines in same domain
[Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'. Reason: Not associated with a trusted SQL Server connection]
Obviously it's a complaint about the user has no access to the database server. But, why it's trying to connect to database server using the Anonymous Logon ?
When connecion to a database server which using windows authcentication mode from a ASP.Net web applicaiton,
- If impersonation is enabled, the user account used to connect to database server is the use account specificed in impersonate section in web.config.
- If impersonation is disabed, the user account used to connect to database server is which specificed in the application pool which the web application is running under.
So here is my solution:
- Use a Sql server logon instead of a windows account to access the database. You will have to ask your DBA to create a sql logon for you. This is the easist way.
- Use a Windows user account to access the database. To do this,
- Ask your administrator to create an account has similar priveleges with Network Service or ASPNET account.
- Set that account as anonymous access acount in op web if you need the anonymous access to be enabled.
- Ask your DBA to grant database access to that account and [Anonymous Logon] if necessary.
- Or, if you dont want to mess up with the IIS configuration, you can simply set the impersonate on in your web.config