Quantcast
Channel: Security
Viewing all articles
Browse latest Browse all 4737

Login to SQL database without using DefaultAppPool login

$
0
0

Hi,

I have an SQL Express 2014 database in my local machine and a .NET 4.5 web app which connects to it. To run my app using my local machine for the purpose of demos to clients, I Publish my web app to the local drive and run it off localhost IIS. In my local IIS Manager, I created an Application Pool 'DefaultAppPool' which is used to login to the SQL database. I also added a User for my database 'IIS APPPOOL\DefaultAppPool', which has the necessary permissions to access the database.

My problems started when I had to remove User 'IIS APPPOOL\DefaultAppPool' in order to deploy my app to Azure (which doesn't allow usernames with a '\'). Now when I run my app on localhost, it spits out an error:

System.Data.SqlClient.SqlException: Cannot open database "myDB" requested by the login. The login failed. Login failed for user 'IIS APPPOOL\DefaultAppPool'.

Question: How can I connect to my database from IIS without creating a user 'IIS APPPOOL\DefaultAppPool' in SQL Server? My database currently has a User 'dbo' which has full access to the tables. How can I get IIS to use 'dbo' to login to the SQL database?

I have no issue giving the IIS full access to my database, as it is all on my local machine. Thank you.


Viewing all articles
Browse latest Browse all 4737

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>