简体   繁体   中英

Should we have to use Failover Group server name or Primary server name in SQL Server managed instance connection string

We have configured a failover group for our SQL Server Managed Instance in Azure portal:

在此处输入图像描述

  • Primary Managed Instance : myprod01.asbcdef.database.windows.net

  • Failover Group Name : failover-myprod01.asbcdef.database.windows.net

My current connection string(uses Primary server name):

server=tcp:myprod01.asbcdef.database.windows.net,1433;
    Persist Security Info=False;Initial Catalog=Mydatabase;User Id=user;
    Password=pwd;MultipleActiveResultSets=False;Encrypt=True;
    TrustServerCertificate=False;Connection Timeout=30;

Which server name should I have to use in connection string to make sure failover will happen in case of any issues, is it primary server or failover group name?

We should connect to the failover group name. So that if Primary server down, it will auto migrate to the Secondary server. Our application will run uninterrupted.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM