none
EDMX model and SQL Server Authentication RRS feed

  • Question

  • I am planning to create EDMX model as part of my application which will be deployed as an IIS site with a specific application pool identity. This application pool identity is a windows group account and has access to database server.

    When creating EDMX model, I am shown below connection properties screen. I am not sure how to connect to the database server. Do I need to use Windows authentication?? My goal is to prevent from hardcoding the username password in app.config and instead use application pool identity to access database.

    Any pointers will be appreciated.

    Wednesday, July 31, 2019 10:26 PM

Answers

  • My requirement was to be able to use application pool's identity in production environment. I solved this by modifying the connection string in production to use "Integrated Security=SSPI;"

    ....connectionString="server=*****; Integrated Security=SSPI; database=****" />

    • Marked as answer by diffident Monday, August 5, 2019 2:48 PM
    Monday, August 5, 2019 2:48 PM

All replies

  • Hi diffident,

    Usually, use "Windows Authentication" to verify identity and connect to the database.

    For more information about "Authentication", you can refer to this document.

    Connect to Server (Login Page) Database Engine.

    Regards,

    Kyle


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, August 1, 2019 9:57 AM
    Moderator
  • but in my case, wouldn't the currently logged in user different from application pool identity? how will it work in these cases where they are different?
    Thursday, August 1, 2019 2:52 PM
  • but in my case, wouldn't the currently logged in user different from application pool identity? how will it work in these cases where they are different?

    One use NetworkService for Windows Autentication 

    https://docs.microsoft.com/en-us/iis/manage/configuring-security/application-pool-identities

    Thursday, August 1, 2019 8:39 PM
  • My requirement was to be able to use application pool's identity in production environment. I solved this by modifying the connection string in production to use "Integrated Security=SSPI;"

    ....connectionString="server=*****; Integrated Security=SSPI; database=****" />

    • Marked as answer by diffident Monday, August 5, 2019 2:48 PM
    Monday, August 5, 2019 2:48 PM