Additional SQL Server features and topics not covered by specific categories
Hi @shengling coady ,
Does the listener automatically move to the new primary?
The Availability group (AG) listener directs incoming connections to either primary or read replica depending on how the AG is configured (whether it allows read requests or not).
An availability group listener is a virtual network name (VNN) that clients can connect to in order to access a database in a primary or secondary replica of an Always On availability group without explicitly specifying the SQL Server instance name. You don’t even need to know the instance name to connect to an AG.
During a failover, all client requests are terminated. After the failover, when a client reconnects to the AG listener, the listener will reconnect to the new primary (except for read intent connect requests).
Anything we need to change on the application to point to the listener
Specify the availability group listener DNS name in the connection string to connect to the primary replica for read-write access, For example, to connect to the primary replica in SQL Server Management Studio through the listener, enter the listener DNS name in the server name field: During a failover, when the primary replica changes, existing connections to the listener are disconnected and new connections are routed to the new primary replica.
-------------
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.