Availability Group Endpoints and Certificates
Information
Adding an availability group can fail if there is an existing endpoint using the default port of 5022. For example if there are multiple SQL Server instances on a server and one of them was previously part of an availability group it may still have an endpoint configured. If you go into the SQL Server ERRORLOGS you may find an error that says:
Server TCP provider failed to listen on [0.0.0.0 <ipv4> 5022] Tcp port is already in use
Old certificates can also cause issues, as one of the requirements is that certificates match between instances participating in an availability group.
caution
Consult with your SQL Database Administrator before removing endpoints or dropping certificates as they may already be in use by an existing availability group.