2007年7月23日

[SQL]Not associated with a trusted SQL Server connection

We had a integration issue while building a operation web to manage BizTalk Server 2006 comfigurations. Bellow is our environment:



  • BizTalk Server 2006 installed on Machine1
  • SQL Server installed on Machine2
  • OpWeb installed on Machine1, Using Forms authentication mode
  • Both machines in same domain
We want to configure BizTalk Server 2006 via op_web.The problems here is that I keep getting this error:
[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,

  1. If impersonation is enabled, the user account used to connect to database server is the use account specificed in impersonate section in web.config.
  2. 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:

  1. 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.
  2. Use a Windows user account to access the database. To do this,
    1. Ask your administrator to create an account has similar priveleges with Network Service or ASPNET account.
    2. Set that account as anonymous access acount in op web if you need the anonymous access to be enabled.
    3. Ask your DBA to grant database access to that account and [Anonymous Logon] if necessary.
    4. Or, if you dont want to mess up with the IIS configuration, you can simply set the impersonate on in your web.config

沒有留言:

Blog Archive

About Me