1

Question edited to show some new screenshots of my attempt to give DefaultAppPool access to the database...(the rest of the question is the same, and unchanged): enter image description here enter image description here enter image description here


The rest of the question, unchanged:

Database access was not a problem with the built-in IIS Express, because my program was running under the user logged into windows. I am new to Web Development.

With Windows Home, you are not allowed to use Windows Authentication--the option is not even present when you go to add\remove feature, and consensus is that you have to upgrade your OS for this to be available.

Hence, the program runs under the app pool account.

So I tried to go into SQL Server and give IIS APPPool\DefaultAppPool account access, but it would not let me.

So I went ahead and turned on impersonation, so that it will run under IUSR account, and I gave that account access to the database, as per screenshots.

But the program still crashes and reports that, "Login Failed..."

How do I run the program in IIS and not IIS Express?

Pic1 Pic2

HillOfBeans
  • 99
  • 10
  • Try setting the Application Pool identity to your windows user - https://stackoverflow.com/questions/29661653/local-iis-unable-to-connect-local-database/29661837#29661837 – ste-fu Jul 01 '19 at 14:25
  • 1
    "So I tried to go into SQL Server and give IIS APPPool\DefaultAppPool account access, but it would not let me." I solved this exact problem, by doing just that. What do you mean by, "it would not let me"? – lionthefox Jul 01 '19 at 14:29
  • lionthefox: edited question as per your comment. – HillOfBeans Jul 01 '19 at 14:43
  • Check out the first answer from here...https://stackoverflow.com/questions/1933134/add-iis-7-apppool-identities-as-sql-server-logons Why won't it let you create the account in SQL Server? You might try ensuring the Application is running when you do the steps. Also, if you are creating a new AppPool instead of using DefaultAppPool, give a read thru this: https://learn.microsoft.com/en-us/iis/manage/configuring-security/application-pool-identities – Rich-Lang Jul 01 '19 at 18:32
  • maybe one of the above is the right answer, but i decided to swap computers... I have a desktop 10 pro, so I'll be using that... – HillOfBeans Jul 01 '19 at 18:48

1 Answers1

0

As far as I know, there is no need to use impersonation to access the sql server. The reason why you get account not found error is you use the wrong application pool name.

If you type in the {yourcomputername}\DefaultAppPool, it is not regarded as the application pool identity.

You should use IIS AppPool\DefaultAppPool instead of the {yourcomputername}\DefaultAppPool.

Details, you could refer to below image:

enter image description here

Brando Zhang
  • 22,586
  • 6
  • 37
  • 65