should the multisubnetfailover=True parameter be added to connection strings to Azure failover groups?
2 Answers
Yes. Particularly if you have nodes in different IP subnets, which allows you to avoid a load balancer among other things.
See the Docs for details about migrating SQL Server in Azure VMs to use multi-subnet failover.
If you mean Azure SQL Database or Managed Instance Failover Groups, MultiSubnetFailover doesn't matter as it uses a DNS CName for redirection.
- Failover group read-write listener
A DNS CNAME record that points to the current primary. It's created automatically when the failover group is created and allows the read-write workload to transparently reconnect to the primary when the primary changes after failover. When the failover group is created on a server, the DNS CNAME record for the listener URL is formed as .database.windows.net. After failover, the DNS record is automatically updated to redirect the listener to the new primary.
https://learn.microsoft.com/en-us/azure/azure-sql/database/failover-group-sql-db?view=azuresql
So after a failover, and the TTL for the DNS entry expires, connection attempts will resolve to the IP address of the new primary server. This is similar to the behavior of an Availability Group Listener with RegisterAllProvierIP=0.