-1

We are trying to switch to windows account instead of SQL, This connection string works on my server but won't work on any other server.

return "Server=ServerName\\MyDBInstance;Database=DBName;Integrated Security=false;Trusted_Connection=yes;";

Now Integrated Security=false means that I will provide username and password, but I am not providing anything...

When I asked DB Owner to check which account is being used from my server they stated it's the "Application Pool" account which is what I wanted, but when same connection string is used on other dev servers or on system test server... it tries to get data using NT Anonymous user and won't use application pool account...

When I use console app with stated connection string, they all work, just not in a web application (in web app only works on my server)

How to force web application to use application pool account ?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Mathematics
  • 7,314
  • 25
  • 77
  • 152
  • https://stackoverflow.com/questions/9686186/iis-application-using-application-pool-identity-loses-primary-token? – CodeCaster Jan 23 '18 at 11:08
  • You wrote Trusted_Connection=yes that means Integrated Security=True, why do you put 2 parameters that means the same with opposite values? – sepupic Jan 23 '18 at 11:38

1 Answers1

0

I fixed the issue by following this blog post,

http://surviving-sharepoint.blogspot.co.uk/2013/10/sharepoint-2013-access-denied-using-web.html

Changing aspnet:AllowAnonymousImpersonation value to false fixed the issue with following web config,

"Data Source=DBServerName;Initial Catalog=DBName;Integrated Security = SSPI;";

Mathematics
  • 7,314
  • 25
  • 77
  • 152