TABLE OF CONTENTS
The Always on availability group feature is a high availability and disaster recovery solution that provides an enterprise-level alternative to database mirroring. It maximizes the availability of a set of user databases for an organisation.
As an example, you have 2 databases ‘SQLDBServerA’ & ‘SQLDBServerB’ and a Listener called SQLListener.
Your connection string with the AppSettion.json file would have a "server attribute" of:
- server=tcp: SQLListener; or if using a nonstandard port
- server=tcp: SQLListener,1435; The "tcp: " (note the space) is required to force the use of TCP and needs to be added.
Set up Database Connection
- Determine the SQL listener by logging onto the SQL database server.
- Expand the AlwaysOn High Availability folder.
- Expand the Availability Group.
- The SQL listener should be visible.
- Right click on the SQL listener and select properties to determine the port number specified.
- Open up AppSetting.json file and amend accordingly.
"DatabaseConnection": "Server=tcp: SQLListener, 1433;multiSubnetFailover=True;Database=ManagementStudio;ConnectRetryCount=0;",
How to connect to a "High Availability Listener" setup
How to connect to a "Database Mirroring" setup
SQL Connection string Syntax. (general knowledge, good to have)