Ok so I have set up a Azure Sql Failover group at mydatabase.databsae.windows.net
which contains 2 servers:
mydatabase1.databsae.windows.net
mydatabase2.databsae.windows.net
I go to connectionstrings.com to get my Sql Azure Connection String which looks like so:
Server=tcp:mydatabase.database.windows.net;Database=mySqlDatabase;
User ID=MyUser@[serverName];Password=myPassword;Trusted_Connection=False;
Encrypt=True;
Now the problem lies in User ID=MyUser@[serverName] I have tried:
User ID=MyUser@mydatabase
but that didn't work and repeatedly returns the error:
Database 'mySqlDatabase' on server 'mydatabase' is not currently available. Please retry the connection later
I also tried User ID=MyUser@mydatabase1
and that did work.
But the problem with the above in the connection string is that when I do failover to mydatabase2
I will need to go and update all my connection strings.
So what is the correct connection string when using Sql Failover groups?