Password is required when adding a database to AG group if the database has a master key
Moved this post from my old blog. When you are trying add a database having a ‘master key’ to a AG group, you will see the message in SSMS. You can’t move to next step until you put the correct password of the ‘master key’. This is an requirement of SSMS to help you manage SQL Server database master key password in secondary replicas. Why we have this requirement? When a master key is created, it’s encrypted by both password and service master key. create MASTER KEY ENCRYPTION BY PASSWORD = ‘Password1’; This master key will be open automatically when it’s need for decryption or encryption. In this case, it is not necessary to use the ‘OPEN Master Key’ T-SQL statement. However, when a database is first attached or restored to a new instance of SQL Server, a copy of the database master key (encrypted by the service master key) is not yet stored in the server. You must use the OPEN MASTER KEY statement to decrypt the database master key (DMK). Once the DMK ha...