title: Aspnet core deployment to IIS - HTTP Error 502.3
body: <p>I have created the IIS site and pointed it at the deployment folder. I have enabled stdout logging and this is the error:</p>
  
  <p>info: Microsoft.Extensions.DependencyInjection.DataProtectionServices[0]
        User profile is available. Using 'C:\Users\No Managed Code\AppData\Local\ASP.NET\DataProtection-Keys' as key repository and Windows DPAPI to encrypt keys at rest.
  fail: Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler[1]
        An exception occurred in the database while iterating the results of a query.
        System.Data.SqlClient.SqlException: Cannot open database "KeyStoneDb" requested by the login. The login failed.
        Login failed for user 'IIS APPPOOL\No Managed Code'.</p>
  
  <p>So, I added the login to SQL with all the necessary rights. Retested in DEV - fine, but when running IIS I still get the issue. The Application Pool being used is 'No Managed Code'.</p>
  
  <p>Why cant the app not connect to the database?  </p>