I have A clustered SQL Server Instance that does not fail-over completely due to using SQL authenticating credentials on an appvolumes database for a VDI database.

Marc o 0 Reputation points
2025-09-22T07:03:14.62+00:00

Hello, I have A clustered SQL Server Instance that does not fail over completely due to using SQL authenticating credentials on an AppVolumes database for a VDI database. The account being used to access the database has the user mapping to the appvolumes database removed when it's in the secondary role, so that when it does fail over, the account can not access the database. Is there some reason Appvolumes or VDI cannot use Windows authenticated accounts? If so, how do I make the SQL authenticated work on both servers and fail over properly without requiring human intervention?

SQL Server Database Engine
{count} votes

1 answer

Sort by: Most helpful
  1. Erland Sommarskog 127.4K Reputation points MVP Volunteer Moderator
    2025-09-24T20:49:28.64+00:00

    So if the VDI and AppVolumes databases are third-party products, you will need to ask the vendor why they want SQL authentication.

    It could be that they are using an application login, and it is not uncommon that this is an SQL login. If they have a middle tier that runs as a service, they could use Windows authentication if you create logins and users for their service accounts. Provided that the vendor permits you to specify this in config file or similar.

    Then again, fixing this failover problem is not difficult. You talk about a cluster, but I assume that you have an availability group, since you get this problem with the login mapping.

    On the primary run

    SELECT sid FROM sys.server_principals WHERE name = 'applogin'
    

    and make note of the value

    On the secondary run:

    SELECT @hash = loginproperty('applogin', 'PasswordHash')
    DROP LOGIN applogin
    CREATE LOGIN applogin WITH PASSWORD @hash HASHED, SID = @sidfromprimary
    

    I don't think you can use variables with CREATE LOGIN, but just paste in the values.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.